hack: fix flaky e2e test

Signed-off-by: Viktor Oreshkin <imselfish@stek29.rocks>
This commit is contained in:
Viktor Oreshkin 2022-09-02 18:36:05 +03:00
parent 822b7b2a9b
commit a56303b5bf
2 changed files with 6 additions and 2 deletions

1
test/e2e/template/helmfile/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/*.tgz

View File

@ -106,12 +106,15 @@ func TestHelmfileTemplateWithBuildCommand(t *testing.T) {
hostPort = 5000
}
execDocker(t, "run", "-d", "-p", fmt.Sprintf("%d:5000", hostPort), "--restart=always", "--name", containerName, "registry:2")
execDocker(t, "run", "--rm", "-d", "-p", fmt.Sprintf("%d:5000", hostPort), "--name", containerName, "registry:2")
t.Cleanup(func() {
execDocker(t, "stop", containerName)
execDocker(t, "rm", containerName)
})
// FIXME: this is a hack to wait for registry to be up and running
// please replace with proper wait for registry
time.Sleep(5 * time.Second)
// We helm-package and helm-push every test chart saved in the ./testdata/charts directory
// to the local registry, so that they can be accessed by helmfile and helm invoked while testing.
charts, err := os.ReadDir(chartsDir)