-
Notifications
You must be signed in to change notification settings - Fork 17
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
Add support for cleanup steps #163
Conversation
youve a broken test; |
working on fixing that
sorry, I wrote that in a hurry. this is a WIP PR and I'll add more commits to it. I'd like your review on what it has been done so far, whether it is reasonable or not, and your insights on the missing items :-) Thank you! |
d08bd5f
to
6d604c5
Compare
Signed-off-by: Marcello Barnaba <mbarnaba@meta.com>
Signed-off-by: Marcello Barnaba <mbarnaba@meta.com>
This allows skipping tests that rely on MongoDB, if for instance you are running this environment on an M1 Mac with QEMU via UTM that does not yet support the AVX machine instructions that MongoDB currently requires. Signed-off-by: Marcello Barnaba <mbarnaba@meta.com>
Signed-off-by: Marcello Barnaba <mbarnaba@meta.com>
The cleanup steps are embedded within a TestDescriptor. They are retrieved via an optional separated test fetcher called "CleanupFetcherName" and with its parameters in the "CleanupFetcherTestParameters" property. The TestFetcherBundle structure in pkg/test/fetcher.go is changed adding the cleanup steps alongside the existing test steps. The pluginregistry/bundles.go change checks whether the cleanup fetcher is set and whether its parameters are valid. If that is the case, the cleanup fetcher and its parameters are set in the TestFetcherBundle structure. Then, the TestStepsDescriptors structure in pkg/test/step.go is changed adding again the cleanup name and the resolved cleanup steps alongside the existing test steps. The change in pkg/jobmanager/steps.go checks whether a cleanup fetcher is set and it invokes it passing its parameter to obtain concrete cleanup steps descriptors, that are saved in the TestStepsDescriptors structure. The concrete cleanup steps are stored in the Test object, used at runtime, alongside the existing test steps, and modeled as a list of TestStepBundle structures. The change in pkg/jobmanager/job.go checks whether cleanup steps are defined in the TestStepsDescriptors when building the Test object, and if yes it creates the step bundles for the cleanup steps. The change in pkg/jobmanager/bundles.go massages the existing methods to allow passing a list of test steps instead of a TestStepsDescriptor, so to be able to re-use the methods for both TestSteps and CleanupSteps. Yay for layering :-) Signed-off-by: Marcello Barnaba <mbarnaba@meta.com>
As this is required in the next changeset where each step gets a separate event emitter. Signed-off-by: Marcello Barnaba <mbarnaba@meta.com>
Codecov ReportPatch coverage:
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. Additional details and impacted files@@ Coverage Diff @@
## develop #163 +/- ##
===========================================
+ Coverage 63.17% 63.30% +0.13%
===========================================
Files 165 165
Lines 10473 10587 +114
===========================================
+ Hits 6616 6702 +86
- Misses 3120 3140 +20
- Partials 737 745 +8
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
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.
Adding some comments where I think we still need work
please also change this to merge into |
f254b7d
to
43ac3c3
Compare
This change implements the core of cleanup steps runs after test steps have completed. It is done in a way that steps variables can be shared between test steps and cleanup steps. Signed-off-by: Marcello Barnaba <mbarnaba@meta.com>
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.
not many changes, but one of the tests is failing
bc11a09
to
847392f
Compare
Signed-off-by: Marcello Barnaba <mbarnaba@meta.com>
As the cleanup steps are strictly related to the test they refer to, remove the requirement to be in a named test. Signed-off-by: Marcello Barnaba <mbarnaba@meta.com>
Tests finally pass! 0f7af7c was particularly painful, because I was thinking to make a change affecting only test code, but in reality the code that fetches from storages is the same across tests and prod. Anyway, the change looks reasonable to me. Cheers |
thanks for working on this |
This implements feature request #143.
Missing: