Skip to content

Commit

Permalink
log file and line of focused test
Browse files Browse the repository at this point in the history
  • Loading branch information
FilipLeitner committed Oct 10, 2024
1 parent 6d2e956 commit 56a22b8
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/focused-tests.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Check for Focused Tests

on:
push: # This triggers the workflow on push to any branch
push:
branches:
- '**' # This matches all branches
- "**" # Trigger on push to all branches

jobs:
check-focused-tests:
Expand All @@ -15,8 +15,11 @@ jobs:

- name: Check for fdescribe and fit in projects/hslayers/test
run: |
# Fail the job if any instance of fdescribe( or fit( is found in the specific directory
if grep -r 'fdescribe(' ./projects/hslayers/test || grep -r 'fit(' ./projects/hslayers/test; then
echo "Error: Found focused tests (fdescribe or fit). Please remove them."
# Search for fdescribe or fit in the test directory and print matches with filename and line number
if grep -rn 'fdescribe(' ./projects/hslayers/test || grep -rn 'fit(' ./projects/hslayers/test; then
echo "Error: Found focused tests (fdescribe or fit) in the following files:"
# Show where focused tests were found, including line numbers
grep -rn 'fdescribe(' ./projects/hslayers/test
grep -rn 'fit(' ./projects/hslayers/test
exit 1
fi

0 comments on commit 56a22b8

Please sign in to comment.