Skip to content

warn if no test items found#215

Merged
nickrobinson251 merged 8 commits into
mainfrom
npr-warn-no-tests
Jul 7, 2025
Merged

warn if no test items found#215
nickrobinson251 merged 8 commits into
mainfrom
npr-warn-no-tests

Conversation

@nickrobinson251
Copy link
Copy Markdown
Member

@nickrobinson251 nickrobinson251 commented Jun 30, 2025

It's always seemed slightly odd that running 0 tests looks so similar to successfully running some tests, and (i suspect) this could also confuse our AI overlords tools like Claude Code (as suggested at https://youtu.be/nfOVgz_omlU?feature=shared&t=1168).

@nickrobinson251 nickrobinson251 requested review from Drvi and NHDaly June 30, 2025 10:40
@nickrobinson251
Copy link
Copy Markdown
Member Author

nickrobinson251 commented Jun 30, 2025

Logs a warning:

Before (master)

julia> runtests("test/testfiles/_happy_tests.jl"; name="blahahah_nope")
[ Info: Scanning for test items in project `ReTestItems` at paths: test/testfiles/_happy_tests.jl
[ Info: Finished scanning for test items in 0.04 seconds. Scheduling 0 tests on pid 61468
[ Tests Completed: 0/0 test items were run.
Test Summary: |Time
ReTestItems   | None  0.0s

This PR:

julia> runtests("test/testfiles/_happy_tests.jl"; name="blahahah_nope")
[ Info: Scanning for test items in project `ReTestItems` at paths: test/testfiles/_happy_tests.jl
[ Info: Finished scanning for test items in 0.06 seconds.
┌ Warning: No test items found.
└ @ ReTestItems ~/repos/ReTestItems.jl/src/ReTestItems.jl:381

This is also more consistent with the behaviour we see when the specified file doesn't exist when validate_paths=false (the default):

julia> runtests("test/no_such_tests.jl")
┌ Warning: No such path "test/no_such_tests.jl"
└ @ ReTestItems ~/repos/ReTestItems.jl/src/ReTestItems.jl:121

@nickrobinson251 nickrobinson251 changed the title Warn if no test items found throw if no test items found Jun 30, 2025
@nickrobinson251
Copy link
Copy Markdown
Member Author

nickrobinson251 commented Jun 30, 2025

follow-up PR to make this throw an error, but that can come next: #216

@nickrobinson251 nickrobinson251 changed the title throw if no test items found warn if no test items found Jun 30, 2025
@nickrobinson251 nickrobinson251 enabled auto-merge (squash) July 7, 2025 09:37
@nickrobinson251 nickrobinson251 merged commit 85e216c into main Jul 7, 2025
8 checks passed
@nickrobinson251 nickrobinson251 deleted the npr-warn-no-tests branch July 7, 2025 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants