Skip to content

Commit

Permalink
in ci runner wrapper, no tests kept in memory
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed Jan 17, 2025
1 parent 6f3c25e commit b6f6839
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
3 changes: 3 additions & 0 deletions docs/docs/contributing/howtos.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,9 @@ npm install
# run tests via headless Chrome browser (requires Chrome 64+)
npm run cypress-run-chrome
# use interactive mode to run tests, while keeping memory usage contained (default is 50!)
npx cypress open --config numTestsKeptInMemory=3
# run tests from a specific file
npm run cypress-run-chrome -- --spec cypress/e2e/explore/link.test.ts
Expand Down
8 changes: 6 additions & 2 deletions scripts/cypress_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ def run_cypress_for_test_file(
group_id = f"matrix{group}-file{i}-{attempt}"
cmd = (
f"{XVFB_PRE_CMD} "
f'{cypress_cmd} --spec "{test_file}" --browser {browser} '
f'{cypress_cmd} --spec "{test_file}" '
f"--config numTestsKeptInMemory=0 "
f"--browser {browser} "
f"--record --group {group_id} --tag {REPO},{GITHUB_EVENT_NAME} "
f"--ci-build-id {build_id} "
f"-- {chrome_flags}"
Expand All @@ -64,7 +66,9 @@ def run_cypress_for_test_file(
os.environ.pop("CYPRESS_RECORD_KEY", None)
cmd = (
f"{XVFB_PRE_CMD} "
f"{cypress_cmd} --browser {browser} "
f"{cypress_cmd} "
f"--browser {browser} "
f"--config numTestsKeptInMemory=0 "
f'--spec "{test_file}" '
f"-- {chrome_flags}"
)
Expand Down
2 changes: 1 addition & 1 deletion superset-frontend/cypress-base/cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default eyesPlugin(
defineConfig({
chromeWebSecurity: false,
defaultCommandTimeout: 8000,
numTestsKeptInMemory: 1,
// numTestsKeptInMemory: 0, forced to 0 in CI, default is 50 locally
// Disabled after realizing this MESSES UP rison encoding in intricate ways
experimentalFetchPolyfill: false,
experimentalMemoryManagement: true,
Expand Down

0 comments on commit b6f6839

Please sign in to comment.