Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating Tests for the function submitJobs #3438

Conversation

Bharadwajshivam28
Copy link

refs #3390

Hey @richscott I am creating Test for the function submitJobs

@@ -53,7 +53,7 @@ type FailedSubmissionDetails struct {

func (submitService *SubmitService) SubmitJobs(jobsToSubmit []*SubmitJob) []*FailedSubmissionDetails {
return submitService.submitJobs(jobsToSubmit)
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this change - there shouldn't be extra whitespace at the end of lines. (I think running golangci-lint will warn about things like this, and using go fmt file_xxx.go will fix it for you.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @richscott I will make these changes

@@ -110,7 +110,7 @@ func (submitService *SubmitService) submitWorker(wg *sync.WaitGroup, jobsToSubmi
// submitPod submits a pod to k8s together with any services and ingresses bundled with the Armada job.
// This function may fail partly, i.e., it may successfully create a subset of the requested objects before failing.
// In case of failure, any already created objects are not cleaned up.
func (submitService *SubmitService) submitPod(job *SubmitJob) (*v1.Pod, error) {
func (submitService *SubmitService) submitPod(job *SubmitJob) (*v1.Pod, error) { //iska krna h
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a leftover note or typo - please remove it.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I missed it to remove

@@ -94,3 +94,30 @@ func newArbitraryError(message string) error {
func newArmadaErrCreateResource() error {
return &armadaerrors.ErrCreateResource{}
}

func TestSubmitJobs(t *testing.T){
submitService := &SubmitService{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think running go fmt on this file would collapse the two lines of the SubmitService reference into one, since there are no members declared in it.

@Bharadwajshivam28 Bharadwajshivam28 force-pushed the test_coverage_submit.go branch from 80e1187 to 42244b1 Compare March 8, 2024 00:24
Signed-off-by: shivam <[email protected]>
@Bharadwajshivam28 Bharadwajshivam28 force-pushed the test_coverage_submit.go branch from 42244b1 to cb1ca31 Compare March 8, 2024 00:27
@richscott
Copy link
Member

@Bharadwajshivam28 Can you rebase this branch from master, and then we can verify all issues are addressed and checks succeed? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants