Skip to content

Commit

Permalink
Refine GitHub Actions workflow for Cypress testing
Browse files Browse the repository at this point in the history
- Updated the logic for generating test groups to use 'find' instead of 'ls' for improved accuracy in locating directories.
- Enhanced the fallback condition to handle cases where the generated groups are empty or not found, ensuring a default group is always available.
- Improved logging to provide clearer output regarding the generated test groups.

This update enhances the reliability of the CI process by ensuring proper detection and handling of test groups.
  • Loading branch information
Gkrumbach07 committed Dec 19, 2024
1 parent b0ffee7 commit 8ecdaaa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ jobs:
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))')
GROUPS=$(find frontend/src/__tests__/cypress/cypress/tests/mocked/ -mindepth 1 -maxdepth 1 -type d -printf "%f\n" | jq -R -s -c 'split("\n") | map(select(length > 0))')
echo "Generated groups: $GROUPS"
if [ -z "$GROUPS" ]; then
if [ -z "$GROUPS" ] || [ "$GROUPS" == "[]" ]; then
echo "Warning: No test groups found, falling back to default"
GROUPS='["default"]'
fi
Expand Down

0 comments on commit 8ecdaaa

Please sign in to comment.