question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

sbt testOnly command should fail/warn when no test found

See original GitHub issue

problem

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:open
  • Created 6 years ago
  • Reactions:2
  • Comments:13 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
pedrorijo91commented, May 24, 2017

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 😛)

1reaction
eed3si9ncommented, May 12, 2017

If the root project aggregated subprojects projA, projB, and projC, and you type in testOnly a.foo, would you fail the whole operation because a.foo doesn’t exist on projB?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found