-
Couldn't load subscription status.
- Fork 96
feat: add workload test case for external tests #700
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Patrick J.P. Culp <jpculp@amazon.com>
| if *workloadTestCommand == "" { | ||
| t.Fatal(fmt.Errorf("workloadTestCommand must be set to run workload test")) | ||
| } | ||
| if *workloadTestImage == "" { | ||
| t.Fatal(fmt.Errorf("workloadTestImage must be set to run workload test")) | ||
| } | ||
| if *workloadTestName == "" { | ||
| t.Fatal(fmt.Errorf("workloadTestName must be set to run workload test")) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: just shortening
| if *workloadTestCommand == "" { | |
| t.Fatal(fmt.Errorf("workloadTestCommand must be set to run workload test")) | |
| } | |
| if *workloadTestImage == "" { | |
| t.Fatal(fmt.Errorf("workloadTestImage must be set to run workload test")) | |
| } | |
| if *workloadTestName == "" { | |
| t.Fatal(fmt.Errorf("workloadTestName must be set to run workload test")) | |
| } | |
| if *workloadTestCommand == "" { | |
| t.Fatal("workloadTestCommand must be set to run workload test") | |
| } | |
| if *workloadTestImage == "" { | |
| t.Fatal("workloadTestImage must be set to run workload test") | |
| } | |
| if *workloadTestName == "" { | |
| t.Fatal("workloadTestName must be set to run workload test") | |
| } |
| }). | ||
| Assess("Single node test Job succeeds", func(ctx context.Context, t *testing.T, cfg *envconf.Config) context.Context { | ||
| job := &batchv1.Job{ | ||
| ObjectMeta: metav1.ObjectMeta{Name: *workloadTestName, Namespace: "default"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: is there a default namespace enum in corev1 we can use just for posterity?
| if err != nil { | ||
| t.Error(err) | ||
| } else { | ||
| t.Log(fmt.Sprintf("Test log for %s:", *workloadTestName)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| t.Log(fmt.Sprintf("Test log for %s:", *workloadTestName)) | |
| t.Logf("Test log for %s:", *workloadTestName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this template is actually so minimal i feel like its worth just using the go type for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just want to nit the naming, "workload" is pretty broad, could we pick a clear name with a theme like "jobTemplate"? I'm really open to suggestions but i want to make sure this is sane/immediately readable
Issue #, if available:
Description of changes:
Adds a simple workload test case that runs a command or script within a test container.
Sample output from Python-based "Hello world" type of container:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.