grafana/e2e/run-suite

129 lines
3.1 KiB
Plaintext
Raw Normal View History

#!/usr/bin/env bash
Chore: Enable PR testing in Drone (#26189) * Add Drone configuration Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Add more steps Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Add more steps Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Build front-end before testing it Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Upgrade grafana/build-container Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Add packaging step Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Trigger on push Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Remove some steps Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Enable steps Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Install Dockerize Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Use node image for test-frontend Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Increase number of test workers Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Make plugin installation depend on frontend tests Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Make integration tests depend on frontend tests Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Use grafana/build-container also for front-end tests Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Upgrade dependencies in order to fix front-end tests Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Depend on es-check Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Dont' depend on tests before building front-end Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Add more steps Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Fix packaging Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Simplify Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Try to build images Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Fix e2e tests Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Remove steps Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Install netcat Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Include golangci-lint with grafana/build-container Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Build storybook and docs website Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Fix e2e tests Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Use build image with root user Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Drop CircleCI dependencies Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Fix e2e tests Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Fix e2e under Drone Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Execute e2e server separately Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Use own plugin for building Docker images Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Use Starlark to configure Drone Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Add enterprise steps to pipeline Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Add more enterprise steps to pipeline Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Maintain Yarn cache Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Build enterprise Docker images Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Build Ubuntu Docker images Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Refactor Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Add Postgres integration test Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Add MySQL integration test Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Fix integration tests Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Parameterize integration test DB connections Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Categorize integration tests Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Use grabpl integration-tests Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Remove unintended change Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Drone: Disable Ubuntu Docker images for PR pipeline Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Regenerate yarn.lock Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Upgrade grabpl Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Restore Yarn cache before installing in grafana-enterprise Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Use separate pipelines for OSS and enterprise Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Let OSS builds depend on tests Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Restore Go cache before building back-end Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Reduce number of variants built for PRs Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Fix building of Docker images Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Drone: Simplify logic Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Drone: Use Starlark Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Drone: Fix syntax error Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Convert .drone.star to YAML Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Upgrade AWS Go SDK Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Drone: Fix Go linting Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Undo irrelevant changes Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Revert "Undo irrelevant changes" This reverts commit 5152f65972fc24f579f065beb43c2df929da1f19. * Undo irrelevant changes Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * e2e: Support Circle Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Remove unused script Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * TypeScript fixes Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * TypeScript fixes Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Remove unused script Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * More Drone support Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Remove unused script Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Fix build on Circle Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Remove TODO comment Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-07-10 09:09:21 -05:00
set -xeo pipefail
. scripts/grafana-server/variables
if ((BASH_VERSINFO[0] < 4)); then
echo "Bash ver >= 4 is needed to run this script"
echo "Please upgrade your bash - run 'brew install bash' if you use Homebrew on MacOS"
exit 1;
fi
Chore: Enable PR testing in Drone (#26189) * Add Drone configuration Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Add more steps Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Add more steps Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Build front-end before testing it Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Upgrade grafana/build-container Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Add packaging step Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Trigger on push Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Remove some steps Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Enable steps Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Install Dockerize Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Use node image for test-frontend Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Increase number of test workers Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Make plugin installation depend on frontend tests Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Make integration tests depend on frontend tests Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Use grafana/build-container also for front-end tests Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Upgrade dependencies in order to fix front-end tests Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Depend on es-check Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Dont' depend on tests before building front-end Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Add more steps Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Fix packaging Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Simplify Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Try to build images Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Fix e2e tests Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Remove steps Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Install netcat Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Include golangci-lint with grafana/build-container Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Build storybook and docs website Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Fix e2e tests Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Use build image with root user Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Drop CircleCI dependencies Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Fix e2e tests Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Fix e2e under Drone Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Execute e2e server separately Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Use own plugin for building Docker images Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Use Starlark to configure Drone Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Add enterprise steps to pipeline Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Add more enterprise steps to pipeline Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Maintain Yarn cache Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Build enterprise Docker images Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Build Ubuntu Docker images Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Refactor Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Add Postgres integration test Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Add MySQL integration test Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Fix integration tests Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Parameterize integration test DB connections Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Categorize integration tests Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Use grabpl integration-tests Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Remove unintended change Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Drone: Disable Ubuntu Docker images for PR pipeline Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Regenerate yarn.lock Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Upgrade grabpl Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Restore Yarn cache before installing in grafana-enterprise Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Use separate pipelines for OSS and enterprise Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Let OSS builds depend on tests Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Restore Go cache before building back-end Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Reduce number of variants built for PRs Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Fix building of Docker images Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Drone: Simplify logic Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Drone: Use Starlark Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Drone: Fix syntax error Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Convert .drone.star to YAML Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Upgrade AWS Go SDK Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Drone: Fix Go linting Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Undo irrelevant changes Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Revert "Undo irrelevant changes" This reverts commit 5152f65972fc24f579f065beb43c2df929da1f19. * Undo irrelevant changes Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * e2e: Support Circle Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Remove unused script Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * TypeScript fixes Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * TypeScript fixes Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Remove unused script Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * More Drone support Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Remove unused script Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Fix build on Circle Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Remove TODO comment Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-07-10 09:09:21 -05:00
HOST=${HOST:-$DEFAULT_HOST}
PORT=${PORT:-$DEFAULT_PORT}
echo -e "Starting Cypress scenarios"
args=("$@")
CMD="cypress run --browser=chrome"
PARAMS=""
CLEANUP=""
declare -A env=(
[BASE_URL]=${BASE_URL:-"http://$HOST:$PORT"}
[SLOWMO]=0
)
testFilesForSingleSuite="*.spec.ts"
rootForEnterpriseSuite="./e2e/extensions-suite"
Dashboard: POC to run existing e2e with `dashboardScene` feature toggle (#84598) * Standarize e2e for addDashbaord e2e flow * WIP: Duplicate e2e dashboard flows and smoke test for scene e2e tests * Fix autoformatting mistake for bash file * Enable dashboardScene using local storage and only for the scene folder * Add missing folders * Set the feature toggle in the before of all tests * Revert "Standarize e2e for addDashbaord e2e flow" This reverts commit 6b9ea9d5a4370c5c9c963908f827927a667c4f68. * Add missing e2e selectors to NavToolbarActions, and modify addDashboard scene flow * e2e: panels_smokescreen.spec.ts migrated * e2e smokeTestSceneario migrated * Start migrating dashbaord-suite e2e * WIP create variable types * adjust tests for scenes * restore dashboard json file * update scenes version * restore pkg/build/wire/internal/wire/testdata modifications * finalising test adjusments * restore pkg/build/wire/internal/wire/testdata files * add latest scenes version and update tests * add drone setup for dashboard scenes tests * update to latest scenes version * adjust drone errors * adjust indentation in drone yml file * drone adjustments * add github workflow to run scenes e2e * restore drone file * adjust github workflow * wip: github workflow adjustments * test remove gpu * bump * undo formating changes * wip: github workflow debugging * adjusting flaky tests * update to latest scenes * clean up workflow file * adjust flaky test * clean up pr * finalise worflow logic and add to codeowners * clean up launching old arch dashboards e2e separately --------- Co-authored-by: Sergej-Vlasov <sergej.s.vlasov@gmail.com> Co-authored-by: Jeff Levin <jeff@levinology.com>
2024-05-01 09:56:48 -05:00
rootForScenesSuite="./e2e/scenes"
declare -A cypressConfig=(
[screenshotsFolder]=./e2e/"${args[0]}"/screenshots
[fixturesFolder]=./e2e/cypress/fixtures
[videosFolder]=./e2e/"${args[0]}"/videos
[downloadsFolder]=./e2e/cypress/downloads
[fileServerFolder]=./e2e/cypress
[specPattern]=./e2e/*-suite/*spec.ts
[defaultCommandTimeout]=30000
[viewportWidth]=1920
[viewportHeight]=1080
[trashAssetsBeforeRuns]=false
[reporter]=./e2e/log-reporter.js
[baseUrl]=${BASE_URL:-"http://$HOST:$PORT"}
)
case "$1" in
"debug")
echo -e "Debug mode"
env[SLOWMO]=1
PARAMS="--no-exit"
;;
"dev")
echo "Dev mode"
CMD="cypress open"
;;
Dashboard: POC to run existing e2e with `dashboardScene` feature toggle (#84598) * Standarize e2e for addDashbaord e2e flow * WIP: Duplicate e2e dashboard flows and smoke test for scene e2e tests * Fix autoformatting mistake for bash file * Enable dashboardScene using local storage and only for the scene folder * Add missing folders * Set the feature toggle in the before of all tests * Revert "Standarize e2e for addDashbaord e2e flow" This reverts commit 6b9ea9d5a4370c5c9c963908f827927a667c4f68. * Add missing e2e selectors to NavToolbarActions, and modify addDashboard scene flow * e2e: panels_smokescreen.spec.ts migrated * e2e smokeTestSceneario migrated * Start migrating dashbaord-suite e2e * WIP create variable types * adjust tests for scenes * restore dashboard json file * update scenes version * restore pkg/build/wire/internal/wire/testdata modifications * finalising test adjusments * restore pkg/build/wire/internal/wire/testdata files * add latest scenes version and update tests * add drone setup for dashboard scenes tests * update to latest scenes version * adjust drone errors * adjust indentation in drone yml file * drone adjustments * add github workflow to run scenes e2e * restore drone file * adjust github workflow * wip: github workflow adjustments * test remove gpu * bump * undo formating changes * wip: github workflow debugging * adjusting flaky tests * update to latest scenes * clean up workflow file * adjust flaky test * clean up pr * finalise worflow logic and add to codeowners * clean up launching old arch dashboards e2e separately --------- Co-authored-by: Sergej-Vlasov <sergej.s.vlasov@gmail.com> Co-authored-by: Jeff Levin <jeff@levinology.com>
2024-05-01 09:56:48 -05:00
"benchmark")
echo "Benchmark"
PARAMS="--headed --no-runner-ui"
env[BENCHMARK_PLUGIN_ENABLED]=true
env[BENCHMARK_PLUGIN_RESULTS_FOLDER]=./e2e/benchmarks/"${args[1]}"/results
cypressConfig[video]=false
cypressConfig[screenshotsFolder]=./e2e/benchmarks/"${args[1]}"/screenshots
cypressConfig[specPattern]=./e2e/benchmarks/"${args[1]}"/$testFilesForSingleSuite
;;
"enterprise")
echo "Enterprise"
CLEANUP="rm -rf ./e2e/extensions-suite"
SETUP="cp -Lr ./e2e/extensions ./e2e/extensions-suite"
enterpriseSuite=$(basename "${args[1]}")
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
cypressConfig[specPattern]=$rootForEnterpriseSuite/$enterpriseSuite/*-suite/*.spec.ts
$CLEANUP && $SETUP
;;
"")
;;
Dashboard: POC to run existing e2e with `dashboardScene` feature toggle (#84598) * Standarize e2e for addDashbaord e2e flow * WIP: Duplicate e2e dashboard flows and smoke test for scene e2e tests * Fix autoformatting mistake for bash file * Enable dashboardScene using local storage and only for the scene folder * Add missing folders * Set the feature toggle in the before of all tests * Revert "Standarize e2e for addDashbaord e2e flow" This reverts commit 6b9ea9d5a4370c5c9c963908f827927a667c4f68. * Add missing e2e selectors to NavToolbarActions, and modify addDashboard scene flow * e2e: panels_smokescreen.spec.ts migrated * e2e smokeTestSceneario migrated * Start migrating dashbaord-suite e2e * WIP create variable types * adjust tests for scenes * restore dashboard json file * update scenes version * restore pkg/build/wire/internal/wire/testdata modifications * finalising test adjusments * restore pkg/build/wire/internal/wire/testdata files * add latest scenes version and update tests * add drone setup for dashboard scenes tests * update to latest scenes version * adjust drone errors * adjust indentation in drone yml file * drone adjustments * add github workflow to run scenes e2e * restore drone file * adjust github workflow * wip: github workflow adjustments * test remove gpu * bump * undo formating changes * wip: github workflow debugging * adjusting flaky tests * update to latest scenes * clean up workflow file * adjust flaky test * clean up pr * finalise worflow logic and add to codeowners * clean up launching old arch dashboards e2e separately --------- Co-authored-by: Sergej-Vlasov <sergej.s.vlasov@gmail.com> Co-authored-by: Jeff Levin <jeff@levinology.com>
2024-05-01 09:56:48 -05:00
"scenes")
env[SCENES]=true
cypressConfig[specPattern]=$rootForScenesSuite/*/$testFilesForSingleSuite
cypressConfig[video]=false
# CMD="cypress open"
;;
*)
cypressConfig[specPattern]=./e2e/"${args[0]}"/$testFilesForSingleSuite
cypressConfig[video]=${args[1]}
;;
esac
function join () {
local -n map=$1
local delimiter=","
local res=""
for key in "${!map[@]}"
do
value=${map[$key]}
if [ -z "${res}" ]; then
res=$key=$value
else
res=$res$delimiter$key=$value
fi
done
echo "$res"
}
export TZ="Pacific/Honolulu"
yarn run $CMD --env "$(join env)" \
--config "$(join cypressConfig)" \
$PARAMS
$CLEANUP