mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
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
This commit is contained in:
parent
05ea450dd2
commit
1bf53e7a5f
1
.github/CODEOWNERS
vendored
1
.github/CODEOWNERS
vendored
@ -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
|
||||
|
44
.github/workflows/run-schema-v2-e2e.yml
vendored
Normal file
44
.github/workflows/run-schema-v2-e2e.yml
vendored
Normal file
@ -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…
Reference in New Issue
Block a user