From a23b1a3624c0b114fd832abd2757921cf4542c7f Mon Sep 17 00:00:00 2001 From: Saqib Ansari Date: Thu, 19 Mar 2026 14:03:27 +0530 Subject: [PATCH] fix: disable cloud parallelization --- .github/workflows/_base-ui-tests.yml | 4 ++-- cypress.config.js | 6 +++++- frappe/commands/testing.py | 7 +++++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/_base-ui-tests.yml b/.github/workflows/_base-ui-tests.yml index 82d35320e4..5d7b44e369 100644 --- a/.github/workflows/_base-ui-tests.yml +++ b/.github/workflows/_base-ui-tests.yml @@ -110,9 +110,9 @@ jobs: run-ui-tests ${{ github.event.repository.name }} \ --with-coverage \ --headless \ - --parallel \ --browser ${{ env.BROWSER_PATH }} \ - --ci-build-id $GITHUB_RUN_ID-$GITHUB_RUN_ATTEMPT + --ci-build-id $GITHUB_RUN_ID-$GITHUB_RUN_ATTEMPT \ + --group ui-shard-${{ matrix.index }} env: CYPRESS_RECORD_KEY: 4a48f41c-11b3-425b-aa88-c58048fa69eb SPLIT: ${{ inputs.parallel-runs }} diff --git a/cypress.config.js b/cypress.config.js index 0267ee62db..d8c24119f7 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -21,9 +21,13 @@ module.exports = defineConfig({ // We've imported your old cypress plugins here. // You may want to clean this up later by importing these. setupNodeEvents(on, config) { + // Splitting tests only works when Cypress Cloud is not orchestrating parallel runs. + if (process.env.CYPRESS_CLOUD_PARALLEL !== "1") { + cypressSplit(on, config); + } + // Delete videos for specs without failing or retried tests // https://docs.cypress.io/guides/guides/screenshots-and-videos#Delete-videos-for-specs-without-failing-or-retried-tests - cypressSplit(on, config); on("after:spec", (spec, results) => { if (results && results.video) { const failures = results.tests.some((test) => diff --git a/frappe/commands/testing.py b/frappe/commands/testing.py index 0cf53d1111..78468b0fd3 100644 --- a/frappe/commands/testing.py +++ b/frappe/commands/testing.py @@ -447,7 +447,7 @@ def run_ui_tests( context: CliCtxObj, app, headless=False, - parallel=True, + parallel=False, with_coverage=False, browser="chrome", ci_build_id=None, @@ -519,7 +519,10 @@ def run_ui_tests( run_or_open = f"run --browser {browser}" if headless else "open" if headless and spec: run_or_open += f" --spec {spec}" - formatted_command = f"{site_env} {password_env} {coverage_env} {cypress_path} {run_or_open}" + parallel_env = "CYPRESS_CLOUD_PARALLEL=1" if parallel else "CYPRESS_CLOUD_PARALLEL=0" + formatted_command = ( + f"{site_env} {password_env} {coverage_env} {parallel_env} {cypress_path} {run_or_open}" + ) if os.environ.get("CYPRESS_RECORD_KEY"): formatted_command += " --record"