SM Checks: Select probes automatically #2298
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0 | |
with: | |
go-version-file: go.mod | |
- uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3.1.2 | |
- run: make integration-test | |
cloudinstance: | |
concurrency: | |
group: cloud-instance | |
cancel-in-progress: false | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0 | |
with: | |
go-version-file: go.mod | |
- uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3.1.2 | |
- 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 | |
GRAFANA_CLOUD_PROVIDER_URL=cloudprovider-tests:url | |
GRAFANA_CLOUD_PROVIDER_TEST_AWS_ACCOUNT_RESOURCE_ID=cloudprovider-tests:test-aws-account-resource-id | |
GRAFANA_CLOUD_PROVIDER_ACCESS_TOKEN=cloudprovider-tests:access-token | |
GRAFANA_CLOUD_PROVIDER_AWS_ROLE_ARN=cloudprovider-tests:aws-role-arn | |
GRAFANA_CLOUD_PROVIDER_TEST_STACK_ID=cloudprovider-tests:test-stack-id | |
- uses: iFaxity/wait-on-action@a7d13170ec542bdca4ef8ac4b15e9c6aa00a6866 # v1.2.1 | |
with: | |
resource: ${{ env.GRAFANA_URL }} | |
interval: 2000 # 2s | |
timeout: 30000 # 30s | |
- uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.0.0 | |
with: | |
timeout_minutes: 30 | |
max_attempts: 3 # Try 3 times to make sure we don't report failures on flaky tests | |
command: 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'] | |
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: 'enterprise' | |
- version: '10.4.3' | |
type: 'enterprise' | |
subset: 'enterprise' | |
- version: '9.5.18' | |
type: 'enterprise' | |
subset: 'enterprise' | |
# Generate tests | |
- version: '11.0.0' | |
type: 'enterprise' | |
subset: 'generate' | |
- version: '10.4.3' | |
type: 'enterprise' | |
subset: 'generate' | |
name: ${{ matrix.version }} - ${{ matrix.type }} - ${{ matrix.subset }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0 | |
with: | |
go-version-file: go.mod | |
- uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3.1.2 | |
- 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/docker-cache@fb28c93772363301b8d0a6072ce850224b73f74e # v0.5.0 | |
with: | |
key: docker-${{ runner.os }}-${{ matrix.type == 'enterprise' && 'enterprise' || 'oss' }}-${{ matrix.version }} | |
- uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.0.0 | |
with: | |
timeout_minutes: 30 | |
max_attempts: 3 # Try 3 times to make sure we don't report failures on flaky tests | |
command: make testacc-${{ matrix.type }}-docker | |
env: | |
GRAFANA_VERSION: ${{ matrix.version }} | |
TESTARGS: >- | |
${{ matrix.subset == 'enterprise' && '-skip="TestAccGenerate" -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' || '' }} |