Skip to content

Commit

Permalink
Enhance GitHub Actions workflow for Cypress testing
Browse files Browse the repository at this point in the history
- Added detailed logging to check for the existence of the mocked tests directory and its contents.
- Implemented fallback logic to default to 'default' test group if no mocked tests are found.
- Improved output handling to display final test group results.

This update increases the robustness of the CI process by ensuring proper handling of test groups and providing clearer feedback during execution.
  • Loading branch information
Gkrumbach07 committed Dec 19, 2024
1 parent 7c9071b commit b0ffee7
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,33 @@ jobs:
- id: set-groups
shell: bash
run: |
echo "Checking directory structure..."
ls -la frontend/src/__tests__/cypress/cypress/tests/ || echo "Base test directory not found"
echo "Looking for mocked tests directory..."
if [ -d "frontend/src/__tests__/cypress/cypress/tests/mocked" ]; then
echo "Found mocked tests directory. Contents:"
ls -la frontend/src/__tests__/cypress/cypress/tests/mocked/
echo "Generating test groups..."
GROUPS=$(ls frontend/src/__tests__/cypress/cypress/tests/mocked/ | jq -R -s -c 'split("\n") | map(select(length > 0))')
echo "Generated groups: $GROUPS"
if [ -z "$GROUPS" ]; then
echo "Warning: No test groups found, falling back to default"
GROUPS='["default"]'
fi
echo "groups=$GROUPS" >> $GITHUB_OUTPUT
else
echo "Warning: Mocked tests directory not found at expected location:"
echo "frontend/src/__tests__/cypress/cypress/tests/mocked"
echo "Falling back to default group"
echo "groups=['default']" >> $GITHUB_OUTPUT
fi
echo "Final output:"
cat $GITHUB_OUTPUT
Cypress-Tests:
needs: [Setup, Get-Test-Groups]
Expand Down

0 comments on commit b0ffee7

Please sign in to comment.