From 8f9758055e6057d30d6fbc79cdb941b66f3c623e Mon Sep 17 00:00:00 2001 From: Samir Faci Date: Wed, 25 Oct 2023 09:14:35 -0700 Subject: [PATCH] Adding a matrix for token tests --- .github/workflows/go.yml | 9 +++++++-- test/common_test.go | 3 +-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 6dd57fa0..e633e2bc 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -11,11 +11,15 @@ jobs: test: strategy: matrix: + include: + - token_test: 1 + - token_test: 0 go: [ 1.21.0 ] - grafana: [ 8.5.22, 9.4.3, 10.1.4 ] + grafana: [ 9.4.3, 10.1.4 ] env: GRAFANA_INTEGRATION: 1 + TEST_TOKEN_CONFIG: "${{ matrix.token_test }}" runs-on: ubuntu-latest steps: @@ -27,7 +31,8 @@ jobs: - name: Verify go version run: go version - + - name: Verify ENV value + run: echo "cfg: $TEST_TOKEN_CONFIG context: $GDG_CONTEXT_NAME" - uses: actions/cache@v3 with: path: | diff --git a/test/common_test.go b/test/common_test.go index c3416a63..8c032891 100644 --- a/test/common_test.go +++ b/test/common_test.go @@ -117,9 +117,8 @@ func TestMain(m *testing.M) { } func initTest(t *testing.T, cfgName *string) (service.GrafanaService, *viper.Viper) { - //os.Setenv("GDG_CONTEXT_NAME", "testing") apiClient, v := createSimpleClient(t, cfgName) - //temp + if os.Getenv("TEST_TOKEN_CONFIG") != "1" { return apiClient, v }