From a56303b5bf285b1ee204517677f7305a032ea78e Mon Sep 17 00:00:00 2001 From: Viktor Oreshkin Date: Fri, 2 Sep 2022 18:36:05 +0300 Subject: [PATCH] hack: fix flaky e2e test Signed-off-by: Viktor Oreshkin --- test/e2e/template/helmfile/.gitignore | 1 + test/e2e/template/helmfile/snapshot_test.go | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 test/e2e/template/helmfile/.gitignore diff --git a/test/e2e/template/helmfile/.gitignore b/test/e2e/template/helmfile/.gitignore new file mode 100644 index 00000000..17d6b367 --- /dev/null +++ b/test/e2e/template/helmfile/.gitignore @@ -0,0 +1 @@ +/*.tgz diff --git a/test/e2e/template/helmfile/snapshot_test.go b/test/e2e/template/helmfile/snapshot_test.go index e00ac8a2..eb565f79 100644 --- a/test/e2e/template/helmfile/snapshot_test.go +++ b/test/e2e/template/helmfile/snapshot_test.go @@ -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)