From 912d1aedd830dfdda89c5fc0107176b23a96078f Mon Sep 17 00:00:00 2001 From: Saswata Mukherjee Date: Mon, 11 Sep 2023 15:50:08 +0530 Subject: [PATCH] e2e test for ui issue Signed-off-by: Saswata Mukherjee --- Makefile | 2 +- test/e2e/obsctl_test.go | 13 +++++++++++++ test/e2e/services.go | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index f48f50c..27bf81e 100644 --- a/Makefile +++ b/Makefile @@ -133,4 +133,4 @@ lint: $(FAILLINT) $(GOLANGCI_LINT) $(MISSPELL) build format docs check-git deps test-e2e: @rm -rf ./test/e2e/e2e_* @rm -rf ./test/e2e/tmp - @go test -v -timeout 99m github.com/observatorium/obsctl/test/e2e + @go test -v -timeout 99m -run ^TestObsctlMetricsCommands$ github.com/observatorium/obsctl/test/e2e diff --git a/test/e2e/obsctl_test.go b/test/e2e/obsctl_test.go index 273b23a..298d4b7 100644 --- a/test/e2e/obsctl_test.go +++ b/test/e2e/obsctl_test.go @@ -115,6 +115,19 @@ func TestObsctlMetricsCommands(t *testing.T) { e := preTest(t) testutil.Ok(t, os.Setenv("OBSCTL_CONFIG_PATH", filepath.Join(e.SharedDir(), "obsctl", "config.json"))) + t.Run("get ui", func(t *testing.T) { + b := bytes.NewBufferString("") + + contextCmd := cmd.NewObsctlCmd(context.Background()) + + contextCmd.SetOut(b) + contextCmd.SetArgs([]string{"metrics", "ui"}) + testutil.Ok(t, contextCmd.Execute()) + + time.Sleep(time.Second * 500) + + }) + t.Run("get labels for a tenant", func(t *testing.T) { b := bytes.NewBufferString("") diff --git a/test/e2e/services.go b/test/e2e/services.go index c8a5203..4c2a8ca 100644 --- a/test/e2e/services.go +++ b/test/e2e/services.go @@ -15,7 +15,7 @@ import ( // Adapted from https://github.com/observatorium/api/blob/main/test/e2e/services.go. const ( - apiImage = "quay.io/observatorium/api:latest" + apiImage = "quay.io/observatorium/api:main-2023-07-31-2bd304b" upImage = "quay.io/observatorium/up:master-2021-02-12-03ef2f2" thanosImage = "quay.io/thanos/thanos:v0.25.1" thanosRuleSyncerImage = "quay.io/observatorium/thanos-rule-syncer:main-2022-02-01-d4c24bc"