Skip to content

Commit

Permalink
fix: cypress on master doesn't work because of --parallel flag (apach…
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch authored Sep 30, 2024
1 parent 63e17ca commit 999dca7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/bashlib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ cypress-run-all() {
# UNCOMMENT the next few commands to monitor memory usage
# monitor_memory & # Start memory monitoring in the background
# memoryMonitorPid=$!
python ../../scripts/cypress_run.py --parallelism $PARALLELISM --parallelism-id $PARALLEL_ID --retries 5 $USE_DASHBOARD_FLAG
python ../../scripts/cypress_run.py --parallelism $PARALLELISM --parallelism-id $PARALLEL_ID --group $PARALLEL_ID --retries 5 $USE_DASHBOARD_FLAG
# kill $memoryMonitorPid

# After job is done, print out Flask log for debugging
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/superset-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ jobs:
PYTHONPATH: ${{ github.workspace }}
REDIS_PORT: 16379
GITHUB_TOKEN: ${{ github.token }}
USE_DASHBOARD: ${{ github.event.inputs.use_dashboard || (github.ref == 'refs/heads/master' && 'true') || 'false' }}
# use the dashboard feature when running manually OR merging to master
USE_DASHBOARD: ${{ github.event.inputs.use_dashboard == 'true'|| (github.ref == 'refs/heads/master' && 'true') || 'false' }}
services:
postgres:
image: postgres:15-alpine
Expand Down
10 changes: 5 additions & 5 deletions scripts/cypress_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def generate_build_id() -> str:


def run_cypress_for_test_file(
test_file: str, retries: int, use_dashboard: bool, group: str, dry_run: bool
test_file: str, retries: int, use_dashboard: bool, group: str, dry_run: bool, i: int
) -> int:
"""Runs Cypress for a single test file and retries upon failure."""
cypress_cmd = "./node_modules/.bin/cypress run"
Expand All @@ -52,8 +52,8 @@ def run_cypress_for_test_file(
cmd = (
f"{XVFB_PRE_CMD} "
f'{cypress_cmd} --spec "{test_file}" --browser {browser} '
f"--record --group {group} --tag {REPO},{GITHUB_EVENT_NAME} "
f"--parallel --ci-build-id {build_id} "
f"--record --group matrix{group}-file{i} --tag {REPO},{GITHUB_EVENT_NAME} "
f"--ci-build-id {build_id} "
f"-- {chrome_flags}"
)
else:
Expand Down Expand Up @@ -159,9 +159,9 @@ def main() -> None:

# Run each test file independently with retry logic or dry-run
processed_file_count: int = 0
for test_file in spec_list:
for i, test_file in enumerate(spec_list):
result = run_cypress_for_test_file(
test_file, args.retries, args.use_dashboard, args.group, args.dry_run
test_file, args.retries, args.use_dashboard, args.group, args.dry_run, i
)
if result != 0:
print(f"Exiting due to failure in {test_file}")
Expand Down

0 comments on commit 999dca7

Please sign in to comment.