Skip to content

Commit

Permalink
Adding a matrix for token tests
Browse files Browse the repository at this point in the history
  • Loading branch information
safaci2000 committed Oct 25, 2023
1 parent a4c6af8 commit a36f35d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
environment:
GRAFANA_INTEGRATION: 1
TEST_TOKEN_CONFIG: "${{ matrix.token_test }}"

runs-on: ubuntu-latest
steps:
Expand All @@ -27,7 +31,6 @@ jobs:

- name: Verify go version
run: go version

- uses: actions/cache@v3
with:
path: |
Expand All @@ -36,6 +39,9 @@ jobs:
restore-keys: |
${{ runner.os }}-go-
- name: Verify ENV
run: |
echo "cfg: $TEST_TOKEN_CONFIG context: $GDG_CONTEXT_NAME"
- name: Calc coverage
if: "${{ matrix.go == '1.21.0' && matrix.grafana == '10.1.4' }}"
run: |
Expand Down
3 changes: 1 addition & 2 deletions test/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit a36f35d

Please sign in to comment.