-
Notifications
You must be signed in to change notification settings - Fork 88
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
Assessment runner refactors #2123
Assessment runner refactors #2123
Commits on Oct 29, 2024
-
test/e2e: Refactor out common patterns
We have some repeated patterns of looking through list of pods to find the one matching our expected name and then extracting some information from it. Rather than repeat this in multiple places we can refactor this pattern out in assessment_helpers and re-use it. Signed-off-by: stevenhorsman <steven@uk.ibm.com>
Configuration menu - View commit details
-
Copy full SHA for 1f8d476 - Browse repository at this point
Copy the full SHA 1f8d476View commit details -
test/e2e: Rework PodEventExtractor
I used the `PodEventExtractor` method to compare against an expected error message, but didn't realise at the time that it just watched for the first warning message and returned that. We then use this output in `assessment_runner` to see if our expected error description is there. Note: As we use it in the `Assess` phase of testing and the pod should be in the expected state after the `WithSetup`, we should be able to replace the need for the watch and just get a list of the events - Rename to clarify that only warning (and error) events are considered and create a `ComparePodEventDescriptions` method in `assessment_helper` to help simplify the logic in `assessment_runner` and process all warning events looking for a description match, not just the first match. If no error was expected then mark the test as failing. - In some of the tests that expect failure events, as we are no longer watching for the first error, we should wait for pod to have gone into failed state before processing the events, in others we add a retry to check for the message. Based on the above logic we can simplify the instance type testing Signed-off-by: stevenhorsman <steven@uk.ibm.com>
Configuration menu - View commit details
-
Copy full SHA for fd57b7e - Browse repository at this point
Copy the full SHA fd57b7eView commit details -
test/e2e: InstanceType refactor
Refactor out the instance type check to the assessment_helper, to make the assessment_runner flow easier to read Signed-off-by: stevenhorsman <steven@uk.ibm.com>
Configuration menu - View commit details
-
Copy full SHA for 003edef - Browse repository at this point
Copy the full SHA 003edefView commit details -
test/e2e: Refactor out
VerifyAlternateImage
Refactor out the logic that checks the alternativeImage is used to make the assessment_runner flow cleaner Signed-off-by: stevenhorsman <steven@uk.ibm.com>
Configuration menu - View commit details
-
Copy full SHA for c6d937a - Browse repository at this point
Copy the full SHA c6d937aView commit details -
tests/e2e: Refactor out VerifyNydusSnapshotter
- Refactor out the logic that checks if nydus snapshotter was used for image pull, to make the assessment_runner flow cleaner. - Refactor IsPulledWithNydusSnapshotter to use remove the duplicated code and re-use other helper functions Signed-off-by: stevenhorsman <steven@uk.ibm.com>
Configuration menu - View commit details
-
Copy full SHA for 6012a5d - Browse repository at this point
Copy the full SHA 6012a5dView commit details -
test/e2e: Create more helper functions
Create new methods for VerifyCaaPodLogContains and getCaaPod to avoid duplication and improve readability. Signed-off-by: stevenhorsman <steven@uk.ibm.com>
Configuration menu - View commit details
-
Copy full SHA for 54993fa - Browse repository at this point
Copy the full SHA 54993faView commit details -
test/e2e: Remove fail reason test case option
No tests are using the `WithFailReason` option, so remove the code to reduce clutter Signed-off-by: stevenhorsman <steven@uk.ibm.com>
Configuration menu - View commit details
-
Copy full SHA for 98855c2 - Browse repository at this point
Copy the full SHA 98855c2View commit details -
test/e2e: Remove t.Fatal from Assess methods
The [Go Wiki]|(https://go.dev/wiki/TestComments) states > On a practical level, prefer calling t.Error over t.Fatal. > t.Fatal is usually only appropriate when some piece > of test setup fails, without which you cannot run the > test at all. - Update t.Fatal's in assess methods to t.Error's - Pass pointers to pods rather than the Pod, like the Kubernetes e2e pod base does Signed-off-by: stevenhorsman <steven@uk.ibm.com>
Configuration menu - View commit details
-
Copy full SHA for 01254bc - Browse repository at this point
Copy the full SHA 01254bcView commit details -
test/e2e: Refactor VerifyImagePullTimer
Refactor out the logic that checks if the image pull timing, to make the assessment_runner flow cleaner. Signed-off-by: stevenhorsman <steven@uk.ibm.com>
Configuration menu - View commit details
-
Copy full SHA for 3790a9a - Browse repository at this point
Copy the full SHA 3790a9aView commit details -
After confidential-containers#2121 the rust version is no longer needed Signed-off-by: stevenhorsman <steven@uk.ibm.com>
Configuration menu - View commit details
-
Copy full SHA for e1767d2 - Browse repository at this point
Copy the full SHA e1767d2View commit details -
tests: e2e: Add nodeName filter to getCaaPod
As Wainer pointed out in the review, if we ran the e2e tests on a cluster with multiple worker nodes, then our logic for only checking for a single CAA pod might fail, so add an additional nodeName filter, so get the CAA that is running on the same node as the pod. Signed-off-by: stevenhorsman <steven@uk.ibm.com>
Configuration menu - View commit details
-
Copy full SHA for 69e05f0 - Browse repository at this point
Copy the full SHA 69e05f0View commit details