sbt testOnly command should fail/warn when no test found
See original GitHub issueproblem
if you do a typo on the sbt testOnly
command you will hardly notice the test you were expecting didn’t run.
Current output:
(...)
[info] Run completed in 46 milliseconds.
[info] Total number of tests run: 0
[info] Suites: completed 0, aborted 0
[info] Tests: succeeded 0, failed 0, canceled 0, ignored 0, pending 0
[info] No tests were executed.
[info] No tests to run for test:testOnly
[success] Total time: 69 s, completed May 11, 2017 10:36:33 AM
notice the last line, which says success. If you do a quick read, you probably won’t notice. At least myself, I just look for the green or red line at the bottom to see if everything it’s ok.
expectation
Why not fail? Or at least something more noticeable?
notes
Available to contribute, just need some guidelines
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:13 (11 by maintainers)
Top Results From Across the Web
unit testing - sbt testOnly not working - Stack Overflow
From sbt you can try to get the autocompletion for the command: sbt:my-project> testOnly <tab>. When running from command line (so outside ...
Read more >Run specific tests with `sbt testOnly` - Serge Gebhardt (sgeb.io)
Here's how to do that with sbt and ScalaTest. Run specific test suites by passing them as arguments to testOnly : > sbt...
Read more >sbt Reference Manual — Testing
The test task accepts no command line arguments and runs all tests: ... sbt will generate JUnit XML test reports for all tests...
Read more >How to cut the run time of a Spark SBT test suite by 40%
The TalkSpec test file can be run individually with the sbt "testOnly *TalkSpec" command. We can also right click the test and run...
Read more >Chapter 5. Testing - sbt in Action - liveBook · Manning
test runs all of the tests sbt can find in your project. testOnly <testname1> runs only the test(s) specified on the command line....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I would love to contribute. You can assign this to me. I hadn’t a lot of free time to dig into sbt recently, but I think better days are coming 😃 (I already cloned and ran the tests, it’s a good start 😛)
If the root project aggregated subprojects
projA
,projB
, andprojC
, and you type intestOnly a.foo
, would you fail the whole operation becausea.foo
doesn’t exist onprojB
?