Skip to content

Further pathing debugging part 3 #43

Further pathing debugging part 3

Further pathing debugging part 3 #43

Workflow file for this run

name: Test
on: [push, pull_request]
jobs:
CypressMockTests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
container: [1, 2, 3, 4, 5] # Creates 5 parallel executions for Cypress tests.
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/[email protected]
with:
node-version: '18.x'
- name: Install Node.js packages for Cypress
run: npm install
- name: Get test files
id: test-files
run: |
echo "Current working directory:"
pwd
echo "Listing contents of the current directory:"
ls -la
TEST_DIR="frontend/src/__tests__/cypress/cypress/tests/mocked"
echo "Checking for test files in $TEST_DIR"
echo "Listing contents of frontend/src/__tests__/cypress/cypress/tests:"
ls -la frontend/src/__tests__/cypress/cypress/tests/
if [ -d "frontend/src/__tests__/cypress/cypress/tests/mocked" ]; then
TEST_FILES=$(find frontend/src/__tests__/cypress/cypress/tests/mocked -name "*.cy.ts" | tr '\n' ',')
echo "files=$TEST_FILES" >> $GITHUB_OUTPUT
else
echo "Directory does not exist. No test files found." >> $GITHUB_OUTPUT
echo "files=" >> $GITHUB_OUTPUT # Set empty output if no files found
fi
- name: Run Cypress Mock Tests in Parallel
run: |
cd ./frontend && npm run test:cypress-ci -- --headless --no-sandbox --spec $(echo "$TEST_FILES" | tr ',' '\n' | awk 'NR % 5 == ${{ matrix.container }} - 1' | tr '\n' ',')
- uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: cypress-results-${{ strategy.job-index }}
path: ./frontend/src/__tests__/cypress/results/
overwrite: true