grafana/e2e/run-suite
Ashley Harrison 45ff0b5cf6
DatePicker: Fix calendar not showing correct selected range when changing time zones (#73273)
* user essentials mob! 🔱

* user essentials mob! 🔱

lastFile:packages/grafana-ui/src/components/DateTimePickers/TimeRangePicker/CalendarBody.tsx

* user essentials mob! 🔱

lastFile:packages/grafana-ui/src/components/DateTimePickers/TimeRangePicker/CalendarBody.tsx

* user essentials mob! 🔱

* user essentials mob! 🔱

lastFile:e2e/dashboards-suite/dashboard-timepicker.spec.ts

* user essentials mob! 🔱

lastFile:e2e/dashboards-suite/dashboard-timepicker.spec.ts

* user essentials mob! 🔱

* user essentials mob! 🔱

* restore custom.ini

* run betterer + prettier

---------

Co-authored-by: joshhunt <josh@trtr.co>
Co-authored-by: Roxana Turc <anamaria-roxana.turc@grafana.com>
Co-authored-by: Tobias Skarhed <tobias.skarhed@gmail.com>
Co-authored-by: eledobleefe <laura.fernandez@grafana.com>
2023-08-23 12:57:32 +00:00

125 lines
2.9 KiB
Bash
Executable File

#!/usr/bin/env bash
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
HOST=${HOST:-$DEFAULT_HOST}
PORT=${PORT:-$DEFAULT_PORT}
echo -e "Starting Cypress scenarios"
args=("$@")
CMD="start"
PARAMS=""
CLEANUP=""
declare -A env=(
[BASE_URL]=${BASE_URL:-"http://$HOST:$PORT"}
[SLOWMO]=0
)
testFilesForSingleSuite="*.spec.ts"
rootForEnterpriseSuite="extensions-suite"
declare -A cypressConfig=(
[integrationFolder]=../../e2e
[screenshotsFolder]=../../e2e/"${args[0]}"/screenshots
[videosFolder]=../../e2e/"${args[0]}"/videos
[fileServerFolder]=./cypress
[testFiles]=*-suite/*spec.ts
[defaultCommandTimeout]=30000
[viewportWidth]=1920
[viewportHeight]=1080
[trashAssetsBeforeRuns]=false
[videoUploadOnPasses]=false
[reporter]=../../e2e/log-reporter.js
)
cd packages/grafana-e2e
case "$1" in
"debug")
echo -e "Debug mode"
env[SLOWMO]=1
PARAMS="--no-exit"
;;
"dev")
echo "Dev mode"
CMD="open"
;;
"benchmark")
echo "Benchmark"
PARAMS="--headed"
CMD="start-benchmark"
env[BENCHMARK_PLUGIN_ENABLED]=true
env[BENCHMARK_PLUGIN_RESULTS_FOLDER]=../../e2e/benchmarks/"${args[1]}"/results
cypressConfig[video]=false
cypressConfig[integrationFolder]=../../e2e/benchmarks/"${args[1]}"
cypressConfig[screenshotsFolder]=../../e2e/benchmarks/"${args[1]}"/screenshots
cypressConfig[testFiles]=$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="open"
enterpriseSuite=$(basename "${args[2]}")
;;
esac
cypressConfig[testFiles]=$rootForEnterpriseSuite/$enterpriseSuite/*-suite/*.spec.ts
$CLEANUP && $SETUP
;;
"")
;;
*)
cypressConfig[integrationFolder]=../../e2e/"${args[0]}"
cypressConfig[testFiles]=$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 $CMD --env "$(join env)" \
--config "$(join cypressConfig)" \
$PARAMS
$CLEANUP