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: preload httpbin and grpcbin images #343

Merged
merged 2 commits into from
Sep 14, 2023
Merged

e2e: preload httpbin and grpcbin images #343

merged 2 commits into from
Sep 14, 2023

Conversation

roobre
Copy link
Collaborator

@roobre roobre commented Sep 13, 2023

Description

This PR adds the kennethreitz/httpbin and moul/grpcbin to the e2e cluster before tests are run. By doing this, images will be ready when e2e scenarios run, so the time that they take to download won't count against the test timeout, reducing test flakyness.

Checklist:

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works.
  • I have run linter locally (make lint) and all checks pass.
  • I have run tests locally (make test) and all tests pass.
  • I have run relevant integration test locally (make integration-xxx for affected packages)
  • I have run relevant e2e test locally (make e2e-xxx for disruptors, or cluster related changes)
  • Any dependent changes have been merged and published in downstream modules

Copy link
Collaborator

@pablochacin pablochacin left a comment

Choose a reason for hiding this comment

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

I would prefer to load these images in the corresponding test setup, instead of by default, as I expect the images needed for each test to change over time.

@roobre
Copy link
Collaborator Author

roobre commented Sep 13, 2023

@pablochacin That makes sense. For this to work though, I had to expose a method to load images after the cluster has been created. Otherwise, these images wouldn't get preloaded when running make e2e-xxx as (as far as I understand it) cluster creation options are ignored if E2E_REUSE is true and a cluster with the same name already exists.

LMK what you think about this approach.

@@ -39,6 +39,14 @@ func Test_PodDisruptor(t *testing.T) {
_ = cluster.Cleanup()
})

err = cluster.Load(
Copy link
Collaborator

Choose a reason for hiding this comment

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

I find this code hard to read, I think we could offer a helper function for extracting the images, but this can be in a follow-up PR.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Agreed, it is a bit confusing. I also considered storing those images on an exported constant, and have both fixtures and this code use those constants, but seemed easier to forget than this.

Copy link
Collaborator

@pablochacin pablochacin left a comment

Choose a reason for hiding this comment

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

Awesome! I like this approach of dynamic image loading

@roobre roobre merged commit bdd2e7b into main Sep 14, 2023
7 checks passed
@roobre roobre deleted the e2e-preload-bins branch September 14, 2023 09:27
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.

None yet

2 participants