Skip to content

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

ci: allow running stress tests on sdk tests (#64759)

Nicolò Pretto1e997d6d5c93
diff --git a/.github/workflows/e2e-stress-test-flake-fix.yml b/.github/workflows/e2e-stress-test-flake-fix.yml
index 4a064364055..22cc91407f2 100644
--- a/.github/workflows/e2e-stress-test-flake-fix.yml
+++ b/.github/workflows/e2e-stress-test-flake-fix.yml
@@ -37,8 +37,26 @@ on:
default: true
jobs:
+ determine-suite:
+ name: Determine test suite
+ runs-on: ubuntu-22.04
+ timeout-minutes: 5
+ outputs:
+ suite: ${{ steps.detect.outputs.suite }}
+ steps:
+ - name: Detect suite from spec path
+ id: detect
+ run: |
+ SPEC='${{ inputs.spec }}'
+ if [[ "$SPEC" == e2e/test-component/scenarios/embedding-sdk/* ]]; then
+ echo "suite=component" >> $GITHUB_OUTPUT
+ else
+ echo "suite=e2e" >> $GITHUB_OUTPUT
+ fi
+
workflow-summary:
name: Stress test inputs
+ needs: [determine-suite]
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
@@ -48,6 +66,7 @@ jobs:
echo '' >> $GITHUB_STEP_SUMMARY
echo '- `branch`: ${{ github.ref_name }}' >> $GITHUB_STEP_SUMMARY
echo '- `spec`: ${{ inputs.spec }}' >> $GITHUB_STEP_SUMMARY
+ echo '- `test_suite` (inferred): ${{ needs.determine-suite.outputs.suite }}' >> $GITHUB_STEP_SUMMARY
echo '- `burn_in`: ${{ inputs.burn_in }}' >> $GITHUB_STEP_SUMMARY
echo '- `grep`: "${{ inputs.grep }}"' >> $GITHUB_STEP_SUMMARY
echo '- `qa_db`: "${{ inputs.qa_db }}"' >> $GITHUB_STEP_SUMMARY
@@ -56,6 +75,7 @@ jobs:
echo 'triggered by: @${{ github.event.sender.login }}' >> $GITHUB_STEP_SUMMARY
stress-test-flake-fix:
+ needs: [determine-suite]
runs-on: ubuntu-22.04
timeout-minutes: 60
name: Stress test E2E flake fix
@@ -100,6 +120,16 @@ jobs:
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
+
+ - name: Prepare back-end environment
+ if: ${{ needs.determine-suite.outputs.suite == 'component' }}
+ uses: ./.github/actions/prepare-backend
+ with:
+ m2-cache-key: "cljs"
+ - name: Build Embedding SDK package
+ if: ${{ needs.determine-suite.outputs.suite == 'component' }}
+ run: yarn build-embedding-sdk-package
+
- name: Prepare JDK 21
uses: actions/setup-java@v4
with:
@@ -118,8 +148,9 @@ jobs:
- name: Stress-test ${{ github.event.inputs.spec }} ${{ github.event.inputs.burn_in }} times
env:
GREP: ${{ github.event.inputs.grep }}
+ CYPRESS_IS_EMBEDDING_SDK: ${{ needs.determine-suite.outputs.suite == 'component' }}
run: |
- node e2e/runner/run_cypress_ci.js e2e \
+ node e2e/runner/run_cypress_ci.js ${{ needs.determine-suite.outputs.suite }} \
--spec '${{ github.event.inputs.spec }}' \
--env burn=${{ github.event.inputs.burn_in }} \
--config-file e2e/support/cypress-stress-test.config.js \
diff --git a/e2e/support/cypress-stress-test.config.js b/e2e/support/cypress-stress-test.config.js
index 6a15e221828..c066dc7d637 100644
--- a/e2e/support/cypress-stress-test.config.js
+++ b/e2e/support/cypress-stress-test.config.js
@@ -1,5 +1,11 @@
const { defineConfig } = require("cypress");
-const { stressTestConfig } = require("./config");
+const {
+ stressTestConfig,
+ embeddingSdkComponentTestConfig,
+} = require("./config");
-module.exports = defineConfig({ e2e: stressTestConfig });
+module.exports = defineConfig({
+ e2e: stressTestConfig,
+ component: { ...embeddingSdkComponentTestConfig, retries: 0 },
+});
diff --git a/e2e/support/helpers/embedding-sdk-component-testing/component-embedding-sdk-helpers.tsx b/e2e/support/helpers/embedding-sdk-component-testing/component-embedding-sdk-helpers.tsx
index 6631c55b587..0fee3deb9d7 100644
--- a/e2e/support/helpers/embedding-sdk-component-testing/component-embedding-sdk-helpers.tsx
+++ b/e2e/support/helpers/embedding-sdk-component-testing/component-embedding-sdk-helpers.tsx
@@ -61,7 +61,9 @@ export function mountSdkContent(
}
if (waitForUser) {
- cy.wait("@getUser").then(({ response }) => {
+ // When running stress tests with network throttling, the request can take longer to complete
+ // as it first needs to fetch the bundle from the server
+ cy.wait("@getUser", { timeout: 20_000 }).then(({ response }) => {
expect(response?.statusCode).to.equal(200);
});
}