mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: consolidate e2e scripts in package.json (#74906)
consolidate e2e scripts in package.json + almost fix benchmarking tests
This commit is contained in:
parent
1ee485ac43
commit
3fdf96d241
@ -34,7 +34,7 @@ module.exports = defineConfig({
|
||||
});
|
||||
|
||||
on('task', {
|
||||
getJSONFilesFromDir: async (relativePath) => {
|
||||
getJSONFilesFromDir: async ({ relativePath }) => {
|
||||
// CWD is set for plugins in the cli but not for the main grafana repo: https://github.com/grafana/grafana/blob/main/packages/grafana-e2e/cli.js#L12
|
||||
const projectPath = config.env.CWD || config.fileServerFolder || process.cwd();
|
||||
const directoryPath = path.join(projectPath, relativePath);
|
||||
|
@ -16,7 +16,7 @@ const hasGrafanaRuntime = <T>(obj: T): obj is WithGrafanaRuntime<T> => {
|
||||
e2e.benchmark({
|
||||
name: 'Live performance benchmarking - 4x20hz panels',
|
||||
dashboard: {
|
||||
folder: '/dashboards/live',
|
||||
folder: '../benchmarks/dashboards/live',
|
||||
delayAfterOpening: 1000,
|
||||
skipPanelValidation: true,
|
||||
},
|
||||
|
@ -16,7 +16,7 @@ echo -e "Starting Cypress scenarios"
|
||||
|
||||
args=("$@")
|
||||
|
||||
CMD="cy:run"
|
||||
CMD="cypress run --browser=chrome"
|
||||
PARAMS=""
|
||||
CLEANUP=""
|
||||
|
||||
@ -51,12 +51,11 @@ case "$1" in
|
||||
;;
|
||||
"dev")
|
||||
echo "Dev mode"
|
||||
CMD="cy:open"
|
||||
CMD="cypress open"
|
||||
;;
|
||||
"benchmark")
|
||||
echo "Benchmark"
|
||||
PARAMS="--headed"
|
||||
CMD="cy:benchmark"
|
||||
PARAMS="--headed --no-runner-ui"
|
||||
env[BENCHMARK_PLUGIN_ENABLED]=true
|
||||
env[BENCHMARK_PLUGIN_RESULTS_FOLDER]=./e2e/benchmarks/"${args[1]}"/results
|
||||
cypressConfig[video]=false
|
||||
@ -77,7 +76,7 @@ case "$1" in
|
||||
;;
|
||||
"dev")
|
||||
echo "Dev mode"
|
||||
CMD="cy:open"
|
||||
CMD="cypress open"
|
||||
enterpriseSuite=$(basename "${args[2]}")
|
||||
;;
|
||||
esac
|
||||
@ -113,7 +112,7 @@ function join () {
|
||||
|
||||
export TZ="Pacific/Honolulu"
|
||||
|
||||
yarn $CMD --env "$(join env)" \
|
||||
yarn run $CMD --env "$(join env)" \
|
||||
--config "$(join cypressConfig)" \
|
||||
$PARAMS
|
||||
|
||||
|
@ -30,13 +30,8 @@ export const benchmark = ({
|
||||
});
|
||||
} else {
|
||||
describe(name, () => {
|
||||
before(() => {
|
||||
cy.session('login', () => e2e.flows.login(e2e.env('USERNAME'), e2e.env('PASSWORD'), true), {
|
||||
cacheAcrossSpecs: true,
|
||||
});
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
e2e.flows.login(e2e.env('USERNAME'), e2e.env('PASSWORD'));
|
||||
e2e.flows.importDashboards(dashboard.folder, 1000, dashboard.skipPanelValidation);
|
||||
});
|
||||
|
||||
|
@ -52,10 +52,7 @@
|
||||
"betterer": "betterer",
|
||||
"betterer:merge": "betterer merge",
|
||||
"betterer:stats": "ts-node --transpile-only --project ./scripts/cli/tsconfig.json ./scripts/cli/reportBettererStats.ts",
|
||||
"betterer:issues": "ts-node --transpile-only --project ./scripts/cli/tsconfig.json ./scripts/cli/generateBettererIssues.ts",
|
||||
"cy:run": "cypress run --browser=chrome",
|
||||
"cy:open": "cypress open",
|
||||
"cy:benchmark": "CYPRESS_NO_COMMAND_LOG=1 cypress run --browser=chrome"
|
||||
"betterer:issues": "ts-node --transpile-only --project ./scripts/cli/tsconfig.json ./scripts/cli/generateBettererIssues.ts"
|
||||
},
|
||||
"grafana": {
|
||||
"whatsNewUrl": "https://grafana.com/docs/grafana/next/whatsnew/whats-new-in-v10-1/",
|
||||
|
Loading…
Reference in New Issue
Block a user