Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

Cypress bail (#71420)

Egor Grushin8b5224136be5
diff --git a/.github/workflows/e2e-stress-test-flake-fix.yml b/.github/workflows/e2e-stress-test-flake-fix.yml
index 91432fe7c9a..97bf06b45bd 100644
--- a/.github/workflows/e2e-stress-test-flake-fix.yml
+++ b/.github/workflows/e2e-stress-test-flake-fix.yml
@@ -31,6 +31,11 @@ on:
type: boolean
required: false
default: true
+ fail_fast:
+ description: "Stop running remaining tests after the first failure"
+ type: boolean
+ required: false
+ default: false
jobs:
determine-test-type:
@@ -67,6 +72,7 @@ jobs:
echo '- `grep`: "${{ inputs.grep }}"' >> $GITHUB_STEP_SUMMARY
echo '- `qa_db`: "${{ inputs.qa_db }}"' >> $GITHUB_STEP_SUMMARY
echo '- `enable_network_throttling`: "${{ inputs.enable_network_throttling }}"' >> $GITHUB_STEP_SUMMARY
+ echo '- `fail_fast`: "${{ inputs.fail_fast }}"' >> $GITHUB_STEP_SUMMARY
echo '' >> $GITHUB_STEP_SUMMARY
echo 'triggered by: @${{ github.event.sender.login }}' >> $GITHUB_STEP_SUMMARY
@@ -144,6 +150,7 @@ jobs:
env:
GREP: ${{ github.event.inputs.grep }}
CYPRESS_BROWSER: ${{ steps.cypress-prep.outputs.chrome-path }}
+ FAIL_FAST: ${{ inputs.fail_fast }}
run: |
node e2e/runner/run_cypress_ci.js ${{ needs.determine-test-type.outputs.type }} \
--spec '${{ github.event.inputs.spec }}' \
diff --git a/e2e/support/cypress-stress-test.config.js b/e2e/support/cypress-stress-test.config.js
index 43ebb12e386..24c81de7620 100644
--- a/e2e/support/cypress-stress-test.config.js
+++ b/e2e/support/cypress-stress-test.config.js
@@ -5,7 +5,23 @@ const {
component: embeddingSdkComponentTestConfig,
} = require("./cypress-embedding-sdk-component-test.config");
+const isFailFastEnabled = process.env.FAIL_FAST === "true";
+
module.exports = defineConfig({
- e2e: { ...defaultConfig, retries: 0 },
- component: { ...embeddingSdkComponentTestConfig, retries: 0 },
+ e2e: {
+ ...defaultConfig,
+ expose: {
+ ...defaultConfig.expose,
+ FAIL_FAST: isFailFastEnabled,
+ },
+ retries: 0,
+ },
+ component: {
+ ...embeddingSdkComponentTestConfig,
+ expose: {
+ ...embeddingSdkComponentTestConfig.expose,
+ FAIL_FAST: isFailFastEnabled,
+ },
+ retries: 0,
+ },
});
diff --git a/e2e/support/cypress.js b/e2e/support/cypress.js
index bcd2fde184d..87e5adf0fc0 100644
--- a/e2e/support/cypress.js
+++ b/e2e/support/cypress.js
@@ -10,6 +10,7 @@ import "./commands";
const isCI = Cypress.expose("CI");
const isNetworkThrottlingEnabled = Cypress.expose("ENABLE_NETWORK_THROTTLING");
+const isFailFastEnabled = Cypress.expose("FAIL_FAST");
// remove default html output on test failure
configure({
@@ -157,6 +158,12 @@ if (isCI) {
require("cypress-terminal-report/src/installLogsCollector")(options);
}
+afterEach(function () {
+ if (isFailFastEnabled && this.currentTest.state === "failed") {
+ Cypress.runner.stop();
+ }
+});
+
beforeEach(function () {
const isCurrentTesOss =
this.currentTest._testConfig.unverifiedTestConfig.tags === "@OSS";