Dashboard Schema V2: E2E setup (#99843)

* basic setup

* update CODEOWNERS

* update name

* add temp test that ensures we are loading schema V2 json in the UI

* update language

* test with yarn cache and combine steps

* revert combine

* remove commented out code

* Run current dashboard suite, make workflow optional

* make job always succeed

* Remove temp v2 suite

* don't run on draft PRs

* command for old arch
pull/100195/head
Haris Rozajac 5 months ago committed by GitHub
parent 05ea450dd2
commit 1bf53e7a5f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 1
      .github/CODEOWNERS
  2. 44
      .github/workflows/run-schema-v2-e2e.yml
  3. 5
      e2e/cypress/support/e2e.js
  4. 19
      e2e/run-suite
  5. 3
      package.json

@ -791,6 +791,7 @@ embed.go @grafana/grafana-as-code
/.github/workflows/publish-kinds-release.yml @grafana/platform-monitoring
/.github/workflows/verify-kinds.yml @grafana/platform-monitoring
/.github/workflows/dashboards-issue-add-label.yml @grafana/dashboards-squad
/.github/workflows/run-schema-v2-e2e.yml @grafana/dashboards-squad
/.github/workflows/ephemeral-instances-pr-comment.yml @grafana/grafana-backend-services-squad
/.github/workflows/create-security-patch-from-security-mirror.yml @grafana/grafana-developer-enablement-squad
/.github/workflows/core-plugins-build-and-release.yml @grafana/plugins-platform-frontend @grafana/plugins-platform-backend

@ -0,0 +1,44 @@
name: Run dashboard schema v2 e2e
on:
push:
branches:
- main
pull_request:
branches:
- '**'
env:
ARCH: linux-amd64
jobs:
dashboard-schema-v2-e2e:
runs-on: ubuntu-latest
continue-on-error: true
if: github.event.pull_request.draft == false
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Pin Go version to mod file
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- run: go version
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'
- name: Install dependencies
run: yarn install --immutable
- name: Build grafana
run: make build
- name: Install Cypress dependencies
uses: cypress-io/github-action@v6
with:
runTests: false
- name: Run dashboard scenes e2e
run: yarn e2e:schema-v2 || echo "Test failed but marking as success since schema V2 is behind a feature flag and should not block PRs"
- name: Always succeed # This is a workaround to make the job pass even if the previous step fails
if: failure()
run: exit 0

@ -50,4 +50,9 @@ beforeEach(() => {
cy.logToConsole('disabling dashboardScene feature toggle in localstorage');
cy.setLocalStorage('grafana.featureToggles', 'dashboardScene=false');
}
if (Cypress.env('useV2DashboardsAPI')) {
cy.logToConsole('enabling v2 dashboards API in localstorage');
cy.setLocalStorage('grafana.featureToggles', 'useV2DashboardsAPI=true');
}
});

@ -28,6 +28,7 @@ declare -A env=(
testFilesForSingleSuite="*.spec.ts"
rootForEnterpriseSuite="./e2e/extensions-suite"
rootForOldArch="./e2e/old-arch"
rootForDashboardsSchemaV2="./e2e/dashboards-suite"
declare -A cypressConfig=(
[screenshotsFolder]=./e2e/"${args[0]}"/screenshots
@ -111,6 +112,24 @@ case "$1" in
cypressConfig[video]=${args[1]}
env[DISABLE_SCENES]=true
;;
"dashboards-schema-v2")
env[useV2DashboardsAPI]=true
cypressConfig[specPattern]=$rootForDashboardsSchemaV2/$testFilesForSingleSuite
cypressConfig[video]=false
case "$2" in
"debug")
echo -e "Debug mode"
env[SLOWMO]=1
PARAMS="--no-exit"
enterpriseSuite=$(basename "${args[2]}")
;;
"dev")
echo "Dev mode"
CMD="cypress open"
enterpriseSuite=$(basename "${args[2]}")
;;
esac
;;
"enterprise-smtp")
env[SMTP_PLUGIN_ENABLED]=true
cypressConfig[specPattern]=./e2e/extensions/enterprise/smtp-suite/$testFilesForSingleSuite

@ -11,7 +11,8 @@
"build:stats": "NODE_ENV=production webpack --progress --config scripts/webpack/webpack.stats.js",
"dev": "NODE_ENV=dev nx exec -- webpack --config scripts/webpack/webpack.dev.js",
"e2e": "./e2e/start-and-run-suite",
"e2e:scenes": "./e2e/start-and-run-suite scenes",
"e2e:old-arch": "./e2e/start-and-run-suite old-arch",
"e2e:schema-v2": "./e2e/start-and-run-suite dashboards-schema-v2",
"e2e:debug": "./e2e/start-and-run-suite debug",
"e2e:dev": "./e2e/start-and-run-suite dev",
"e2e:benchmark:live": "./e2e/start-and-run-suite benchmark live",

Loading…
Cancel
Save