Skip to content

Commit

Permalink
test: run cypress tests individually (#2186)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevkevinpal authored Sep 20, 2024
1 parent abf49ae commit e2b5f4f
Showing 1 changed file with 35 additions and 2 deletions.
37 changes: 35 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,42 @@ on:
branches:
- master
jobs:
get-cypress-tests:
runs-on:
ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: ./sphinx-nav-fiber

- name: Debug test files
working-directory: ./sphinx-nav-fiber
run: |
find cypress/e2e -name '*.spec.js' -o -name '*.cy.ts' | jq -R -s -c 'split("\n") | map(select(. != ""))'
- name: List Cypress test files
id: list-tests
working-directory: ./sphinx-nav-fiber
run: |
tests=$(find cypress/e2e -name '*.spec.js' -o -name '*.cy.ts' | jq -R -s -c 'split("\n") | map(select(. != ""))')
if [ -z "$tests" ]; then
echo "No Cypress test files found."
tests="[]"
fi
echo "::set-output name=tests::$tests"
outputs:
tests: ${{ steps.list-tests.outputs.tests }}

cypress-run:
runs-on: ubuntu-latest
needs: get-cypress-tests
strategy:
fail-fast: false
matrix:
file: ${{ fromJson(needs.get-cypress-tests.outputs.tests) }}
steps:
- name: Enable docker.host.internal for Ubuntu
run: |
Expand Down Expand Up @@ -81,6 +115,7 @@ jobs:
browser: chrome
headless: true
start: yarn run start-e2e
spec: ${{ matrix.file }}
wait-on: 'http://localhost:3000' # Waits for above
wait-on-timeout: 120 # Waits for 2 minutes
# Records to Cypress Dashboard
Expand All @@ -100,8 +135,6 @@ jobs:
name: cypress-logs
path: cypress/videos

- name: Check the coverage value
run: yarn test-coverage

- name: Stop Stack
working-directory: ./stack
Expand Down

0 comments on commit e2b5f4f

Please sign in to comment.