Skip to content
This repository has been archived by the owner on Sep 17, 2024. It is now read-only.

Pull fresh docker images before suite #1123

Merged
merged 2 commits into from
May 4, 2021
Merged

Conversation

jalvz
Copy link
Contributor

@jalvz jalvz commented May 4, 2021

What does this PR do?

Pull fresh Docker images before the suite runs, with the possibility to opt out. If Docker images are current, this takes a couple of seconds, which is marginal considering how long the whole suite takes (even just one scenario).

This makes sure that a test only uses the most recent images and not stale ones.

The clean-docker make target is still kept for convenience, although it probably can be removed in a follow up PR.

@jalvz jalvz added the enhancement New feature or request label May 4, 2021
@elasticmachine
Copy link
Contributor

elasticmachine commented May 4, 2021

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: Pull request #1123 updated

  • Start Time: 2021-05-04T16:12:35.053+0000

  • Duration: 22 min 4 sec

  • Commit: 5428fa1

Test stats 🧪

Test Results
Failed 0
Passed 152
Skipped 0
Total 152

Trends 🧪

Image of Build Times

Image of Tests

💚 Flaky test report

Tests succeeded.

Expand to view the summary

Test stats 🧪

Test Results
Failed 0
Passed 152
Skipped 0
Total 152

@@ -215,3 +223,31 @@ func InitializeIngestManagerTestSuite(ctx *godog.TestSuiteContext) {
}
})
}

func pullFreshImages(stackVersion, agentVersion, kibanaVersion string) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

Wdyt about moving an abstraction of the PullFreshImages method to the internal docker package?

@@ -135,6 +138,11 @@ func InitializeIngestManagerTestSuite(ctx *godog.TestSuiteContext) {
"stackVersion": common.StackVersion,
}

if !shell.GetEnvBool("SKIP_PULL") {
Copy link
Contributor

Choose a reason for hiding this comment

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

There is a section for Environment variables affecting the build: https://github.com/elastic/e2e-testing/tree/master/e2e#environment-variables-affecting-the-build Can we add info about this new var there?

Copy link
Contributor

@adam-stokes adam-stokes left a comment

Choose a reason for hiding this comment

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

I like @mdelapenya idea of moving pullFreshImages into internal/docker, once that's done this PR should be good to go

@@ -436,3 +437,32 @@ func getDockerClient() *client.Client {

return instance
}

// PullImages pulls images
func PullImages(stackVersion, agentVersion, kibanaVersion string) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

One little one: because this method could be reused across different test suites, i.e. metricbeat, we could pass the images array as parameter.

Again, it's not a blocker and it could be done in a follow-up PR.

@adam-stokes adam-stokes merged commit 77eaee8 into elastic:master May 4, 2021
@mdelapenya mdelapenya mentioned this pull request May 5, 2021
8 tasks
mergify bot pushed a commit that referenced this pull request May 5, 2021
* Pull fresh docker images before suite

* code review

(cherry picked from commit 77eaee8)
mergify bot pushed a commit that referenced this pull request May 5, 2021
* Pull fresh docker images before suite

* code review

(cherry picked from commit 77eaee8)
mdelapenya pushed a commit that referenced this pull request May 5, 2021
* Pull fresh docker images before suite

* code review

(cherry picked from commit 77eaee8)

Co-authored-by: Juan Álvarez <juan.alvarez@elastic.co>
mdelapenya pushed a commit that referenced this pull request May 5, 2021
* Pull fresh docker images before suite

* code review

(cherry picked from commit 77eaee8)

Co-authored-by: Juan Álvarez <juan.alvarez@elastic.co>
mdelapenya added a commit that referenced this pull request May 6, 2021
* 7.x:
  Pull fresh docker images before suite (#1123) (#1140)
mdelapenya added a commit that referenced this pull request May 6, 2021
* 7.13.x:
  Pull fresh docker images before suite (#1123) (#1141)
mdelapenya added a commit that referenced this pull request May 6, 2021
* 7.x:
  chore: abstract image pulling (#1137) (#1138)
  Pull fresh docker images before suite (#1123) (#1140)
mdelapenya added a commit that referenced this pull request May 6, 2021
* 7.13.x:
  chore: abstract image pulling (#1137) (#1139)
  Pull fresh docker images before suite (#1123) (#1141)
mdelapenya added a commit to mdelapenya/e2e-testing that referenced this pull request May 6, 2021
* master:
  chore: update mergify's titles (elastic#1142)
  chore: remove unused pipelines (elastic#1143)
  feat: use Docker copy to transfer binaries to containers (elastic#1136)
  chore: abstract image pulling (elastic#1137)
  Support multiple deployment backends (elastic#1130)
  chore: remove unused code (elastic#1119)
  Unify fleet and stand-alone suites (elastic#1112)
  Pull fresh docker images before suite (elastic#1123)
  chore: initialise timeout factor next to the declaration (elastic#1118)
  chore: match Go version with Beats (elastic#1120)
  feat: support running k8s autodiscover suite for Beats PRs and local repositories (elastic#1115)
  Auto bootstrap fleet during initialize scenario (elastic#1116)
  Kubernetes Deployment (elastic#1110)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request v7.13.0 v7.14.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants