forked from grafana/terraform-provider-grafana
-
Notifications
You must be signed in to change notification settings - Fork 0
111 lines (107 loc) · 3.78 KB
/
acc-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: acceptance tests
on:
pull_request: {}
push:
branches:
- main
# These permissions are needed to assume roles from Github's OIDC.
permissions:
contents: read
id-token: write
jobs:
# Tests that Terraform can actually install and use the provider
# Ex: https://github.com/grafana/terraform-provider-grafana/issues/1372
integration:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.21'
- uses: hashicorp/setup-terraform@v3
- run: make integration-test
cloudinstance:
concurrency: cloud-instance
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.21'
- uses: hashicorp/setup-terraform@v3
- name: Get Secrets
uses: grafana/shared-workflows/actions/get-vault-secrets@main
with:
repo_secrets: |
GRAFANA_AUTH=cloud-instance-tests:auth
GRAFANA_ONCALL_ACCESS_TOKEN=cloud-instance-tests:oncall-token
GRAFANA_SM_ACCESS_TOKEN=cloud-instance-tests:sm-token
GRAFANA_SM_URL=cloud-instance-tests:sm-url
GRAFANA_URL=cloud-instance-tests:url
- uses: iFaxity/[email protected]
with:
resource: ${{ env.GRAFANA_URL }}
interval: 2000 # 2s
timeout: 30000 # 30s
- run: make testacc-cloud-instance
local:
strategy:
fail-fast: false # Let all versions run, even if one fails
matrix:
# OSS tests, run on all versions
version: ['11.0.0', '10.4.3', '9.5.18']
type: ['oss']
subset: ['basic', 'other', 'long', 'generate']
include:
- version: '11.0.0'
type: 'oss'
subset: examples
# TLS proxy tests, run only on latest version
- version: '11.0.0'
type: 'tls'
subset: 'basic'
# Sub-path tests. Runs tests on localhost:3000/grafana/
- version: '11.0.0'
type: 'subpath'
subset: 'basic'
- version: '11.0.0'
type: 'subpath'
subset: 'other'
# Enterprise tests
- version: '11.0.0'
type: 'enterprise'
subset: 'all'
- version: '10.4.3'
type: 'enterprise'
subset: 'all'
- version: '9.5.18'
type: 'enterprise'
subset: 'all'
name: ${{ matrix.version }} - ${{ matrix.type }} - ${{ matrix.subset }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.21'
- uses: hashicorp/setup-terraform@v3
- name: Get Enterprise License
uses: grafana/shared-workflows/actions/get-vault-secrets@main
if: matrix.type == 'enterprise'
with:
repo_secrets: |
GF_ENTERPRISE_LICENSE_TEXT=enterprise:license
- name: Cache Docker image
uses: ScribeMD/[email protected]
with:
key: docker-${{ runner.os }}-${{ matrix.type == 'enterprise' && 'enterprise' || 'oss' }}-${{ matrix.version }}
- run: make testacc-${{ matrix.type }}-docker
env:
GRAFANA_VERSION: ${{ matrix.version }}
TESTARGS: >-
${{ matrix.subset == 'all' && '-parallel 2' || '' }}
${{ matrix.subset == 'basic' && '-run=".*_basic" -short -parallel 2' || '' }}
${{ matrix.subset == 'other' && '-skip=".*_basic" -short -parallel 2' || '' }}
${{ matrix.subset == 'long' && '-run=".*longtest" -parallel 1' || '' }}
${{ matrix.subset == 'examples' && '-run=".*Examples" -parallel 1' || '' }}
${{ matrix.subset == 'generate' && '-run="TestAccGenerate" -parallel 1' || '' }}