* Use bun in package.json * Update workflows * Update more workflows * Kick ci * Fix yaml * Fix type errors * Compat with snyk * Fix jest resolutions * Add another esm package * Fix aliases and next js missing deps * Update next js embed tests * Try fix embed test config * Fix * Fix requires in e2e support * Use bun not yarn in embed bin * Revert config changes * Use bun in more scripts and use prepare-release action * Replace more yarn usages * Remove overrides from bunfig move to package json * Revert e2e support changes * Add back comment * [ci skip] comment typo * Update bun lock * Update to reference bun * Update to reference bun * Update license disclaimer * Tidy tests * Update to use bun in workflows * Change aliases * Update codemirrort selector * Tidy license generation * Remove .only * Fix yarn references * Checkout .github for release scripts * Update lockfile * Re-add package * update release bunlock * fix checkout check --------- Co-authored-by: Ryan Laurie <iethree@gmail.com>
162 lines
5.8 KiB
YAML
162 lines
5.8 KiB
YAML
name: E2E Stress Test Flake Fix
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
spec:
|
|
description: "Relative path of the target spec"
|
|
type: string
|
|
required: true
|
|
burn_in:
|
|
description: "Number of times to run the test (e.g. 20)"
|
|
type: string
|
|
required: true
|
|
default: "20"
|
|
grep:
|
|
description: "Grep and filter tests to run in isolation"
|
|
type: string
|
|
required: false
|
|
mb_edition:
|
|
description: 'Set MB_EDITION env var to "ee" (enterprise) or "oss" (open-source)'
|
|
type: string
|
|
required: false
|
|
default: "ee"
|
|
qa_db:
|
|
description: "Whether to set up and include external QA databases"
|
|
type: boolean
|
|
required: true
|
|
default: false
|
|
enable_network_throttling:
|
|
description: "Enable network throttling simulation (4g slow like in chrome dev tools)"
|
|
type: boolean
|
|
required: false
|
|
default: true
|
|
|
|
jobs:
|
|
determine-test-type:
|
|
name: Determine test type
|
|
runs-on: ubuntu-22.04
|
|
timeout-minutes: 5
|
|
outputs:
|
|
type: ${{ steps.detect.outputs.type }}
|
|
steps:
|
|
- name: Detect test type from spec path
|
|
id: detect
|
|
run: |
|
|
SPEC='${{ inputs.spec }}'
|
|
if [[ "$SPEC" == e2e/test-component/scenarios/embedding-sdk/* ]]; then
|
|
echo "type=component" >> $GITHUB_OUTPUT
|
|
else
|
|
echo "type=e2e" >> $GITHUB_OUTPUT
|
|
fi
|
|
|
|
workflow-summary:
|
|
name: Stress test inputs
|
|
needs: [determine-test-type]
|
|
runs-on: ubuntu-22.04
|
|
timeout-minutes: 5
|
|
steps:
|
|
- name: Generate workflow summary
|
|
run: |
|
|
echo '**Inputs:**' >> $GITHUB_STEP_SUMMARY
|
|
echo '' >> $GITHUB_STEP_SUMMARY
|
|
echo '- `branch`: ${{ github.ref_name }}' >> $GITHUB_STEP_SUMMARY
|
|
echo '- `spec`: ${{ inputs.spec }}' >> $GITHUB_STEP_SUMMARY
|
|
echo '- `test_type` (inferred): ${{ needs.determine-test-type.outputs.type }}' >> $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
|
|
echo '- `enable_network_throttling`: "${{ inputs.enable_network_throttling }}"' >> $GITHUB_STEP_SUMMARY
|
|
echo '' >> $GITHUB_STEP_SUMMARY
|
|
echo 'triggered by: @${{ github.event.sender.login }}' >> $GITHUB_STEP_SUMMARY
|
|
|
|
stress-test-flake-fix:
|
|
needs: [determine-test-type]
|
|
runs-on: ubuntu-22.04
|
|
timeout-minutes: 60
|
|
name: Stress test E2E flake fix
|
|
env:
|
|
DISPLAY: "" # https://github.com/cypress-io/cypress/issues/4034
|
|
TERM: xterm
|
|
TZ: US/Pacific # to make Node match the instance tz
|
|
CYPRESS_MB_ALL_FEATURES_TOKEN: ${{ secrets.STAGING_MB_ALL_FEATURES_TOKEN }}
|
|
CYPRESS_MB_STARTER_CLOUD_TOKEN: ${{ secrets.STAGING_MB_STARTER_CLOUD_TOKEN }}
|
|
CYPRESS_MB_PRO_CLOUD_TOKEN: ${{ secrets.STAGING_MB_PRO_CLOUD_TOKEN }}
|
|
CYPRESS_MB_PRO_SELF_HOSTED_TOKEN: ${{ secrets.STAGING_MB_PRO_SELF_HOSTED_TOKEN }}
|
|
MB_EDITION: ${{ inputs.mb_edition }}
|
|
CYPRESS_ENABLE_NETWORK_THROTTLING: ${{ inputs.enable_network_throttling }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
# Important because we need previous commits hashes to find and download the uberjar!
|
|
fetch-depth: 20
|
|
|
|
- name: Prepare Docker containers
|
|
uses: ./.github/actions/e2e-prepare-containers
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
maildev: true
|
|
openldap: true
|
|
snowplow: true
|
|
postgres: ${{ inputs.qa_db }}
|
|
mysql: ${{ inputs.qa_db }}
|
|
mongo: ${{ inputs.qa_db }}
|
|
|
|
- name: Download Metabase ${{ matrix.edition }} uberjar
|
|
uses: ./.github/actions/e2e-download-uberjar
|
|
with:
|
|
edition: "ee"
|
|
|
|
- name: Prepare front-end environment
|
|
uses: ./.github/actions/prepare-frontend
|
|
- name: Prepare back-end environment
|
|
uses: ./.github/actions/prepare-backend
|
|
|
|
- name: Build Embedding SDK package
|
|
if: ${{ needs.determine-test-type.outputs.type == 'component' }}
|
|
run: bun run build-embedding-sdk-package
|
|
|
|
- name: Prepare Cypress environment
|
|
id: cypress-prep
|
|
uses: ./.github/actions/prepare-cypress
|
|
|
|
- name: Compile CLJS
|
|
run: bun run build-pure:cljs
|
|
|
|
- name: Run Metabase
|
|
run: node e2e/runner/run_cypress_ci.js start
|
|
|
|
- name: Generate default database snapshot
|
|
if: inputs.qa_db == false # true boolean, do not use string here!
|
|
run: |
|
|
node e2e/runner/run_cypress_ci.js snapshot \
|
|
--spec "e2e/snapshot-creators/default.cy.snap.js"
|
|
|
|
- name: Generate all database snapshots
|
|
if: inputs.qa_db
|
|
run: |
|
|
node e2e/runner/run_cypress_ci.js snapshot
|
|
|
|
# For all options and fine-grained control, take a look at the documentation
|
|
# https://github.com/cypress-io/cypress/tree/develop/npm/grep
|
|
- name: Stress-test ${{ github.event.inputs.spec }} ${{ github.event.inputs.burn_in }} times
|
|
env:
|
|
GREP: ${{ github.event.inputs.grep }}
|
|
CYPRESS_BROWSER: ${{ steps.cypress-prep.outputs.chrome-path }}
|
|
run: |
|
|
node e2e/runner/run_cypress_ci.js ${{ needs.determine-test-type.outputs.type }} \
|
|
--spec '${{ github.event.inputs.spec }}' \
|
|
--env burn=${{ github.event.inputs.burn_in }} \
|
|
--config-file e2e/support/cypress-stress-test.config.js
|
|
|
|
- name: Upload Cypress Artifacts upon failure
|
|
uses: actions/upload-artifact@v4
|
|
if: failure()
|
|
with:
|
|
name: cypress-failed-tests-recording
|
|
path: |
|
|
./cypress
|
|
./logs/test.log
|
|
if-no-files-found: ignore
|