fix: disable cloud parallelization
This commit is contained in:
parent
01f2b83e31
commit
a23b1a3624
3 changed files with 12 additions and 5 deletions
4
.github/workflows/_base-ui-tests.yml
vendored
4
.github/workflows/_base-ui-tests.yml
vendored
|
|
@ -110,9 +110,9 @@ jobs:
|
||||||
run-ui-tests ${{ github.event.repository.name }} \
|
run-ui-tests ${{ github.event.repository.name }} \
|
||||||
--with-coverage \
|
--with-coverage \
|
||||||
--headless \
|
--headless \
|
||||||
--parallel \
|
|
||||||
--browser ${{ env.BROWSER_PATH }} \
|
--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:
|
env:
|
||||||
CYPRESS_RECORD_KEY: 4a48f41c-11b3-425b-aa88-c58048fa69eb
|
CYPRESS_RECORD_KEY: 4a48f41c-11b3-425b-aa88-c58048fa69eb
|
||||||
SPLIT: ${{ inputs.parallel-runs }}
|
SPLIT: ${{ inputs.parallel-runs }}
|
||||||
|
|
|
||||||
|
|
@ -21,9 +21,13 @@ module.exports = defineConfig({
|
||||||
// We've imported your old cypress plugins here.
|
// We've imported your old cypress plugins here.
|
||||||
// You may want to clean this up later by importing these.
|
// You may want to clean this up later by importing these.
|
||||||
setupNodeEvents(on, config) {
|
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
|
// 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
|
// 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) => {
|
on("after:spec", (spec, results) => {
|
||||||
if (results && results.video) {
|
if (results && results.video) {
|
||||||
const failures = results.tests.some((test) =>
|
const failures = results.tests.some((test) =>
|
||||||
|
|
|
||||||
|
|
@ -447,7 +447,7 @@ def run_ui_tests(
|
||||||
context: CliCtxObj,
|
context: CliCtxObj,
|
||||||
app,
|
app,
|
||||||
headless=False,
|
headless=False,
|
||||||
parallel=True,
|
parallel=False,
|
||||||
with_coverage=False,
|
with_coverage=False,
|
||||||
browser="chrome",
|
browser="chrome",
|
||||||
ci_build_id=None,
|
ci_build_id=None,
|
||||||
|
|
@ -519,7 +519,10 @@ def run_ui_tests(
|
||||||
run_or_open = f"run --browser {browser}" if headless else "open"
|
run_or_open = f"run --browser {browser}" if headless else "open"
|
||||||
if headless and spec:
|
if headless and spec:
|
||||||
run_or_open += f" --spec {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"):
|
if os.environ.get("CYPRESS_RECORD_KEY"):
|
||||||
formatted_command += " --record"
|
formatted_command += " --record"
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue