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

e2e, reporter: Collect test artifacts #54

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

RamLavi
Copy link
Collaborator

@RamLavi RamLavi commented Dec 21, 2023

This PR introduces a reporter package that manages the artifacts collection after the checkup is run.
The artifacts are saved on "_output" folder which is located under the "test" folder

@RamLavi RamLavi requested a review from orelmisan December 21, 2023 08:23
@RamLavi RamLavi marked this pull request as draft December 21, 2023 10:00
@RamLavi RamLavi marked this pull request as ready for review January 1, 2024 11:51
The ARTIFACTS_DIR env var will be propogated to the e2e test in later
commits, where it will be used to save the test's artifacts.

Signed-off-by: Ram Lavi <[email protected]>
The reporter package will manage the artifacts folder, cleaning it
before the test starts, and populating it with artifacts after the test
ends.
The CheckupReporter is exposing the parameters as public, in order to
introduce more parameters in later commits.
This commit introduces the package skeletin and the Cleanup method.

Signed-off-by: Ram Lavi <[email protected]>
Adding the checkupReporter object to the test suite .

Signed-off-by: Ram Lavi <[email protected]>
The Cleanup function will run at the start of every e2e run, in order to
remove any artifact leftovers.

In order to use the BeforeAll ginkgo function, changing the test
container to run ordered. This has no effective meaning since the e2e
test consists of only one test.

Signed-off-by: Ram Lavi <[email protected]>
The artifacts that are interesting to collect are:
- user configmap
- job logs

Signed-off-by: Ram Lavi <[email protected]>
In order to ensure that the artifacts are not removed before the
collection is performed, the CollectArtifacts method is called in
JustAfterEach, that is guarantieed to run before all AfterEach closures
[0].
For that purposed, ginkgo's DeferCleanup functions are semantically a
dynamic AfterEach functions - so the assumption still holds considering
that the e2e uses DeferCleanup.

[0]
https://onsi.github.io/ginkgo/#cleaning-up-our-cleanup-code-defercleanup

Signed-off-by: Ram Lavi <[email protected]>
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.

1 participant