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.

testOnly runs all test

See original GitHub issue

I have two test classes in the src/it/scala/com/mycompany/myapp/ directory. Let’s say the classes are TestA and TestB. When I run sbt gatling-it:testOnly com.mycompany.myapp.TestB, both tests are run. I’d expect only TestB to be run in this example.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

6reactions
slandellecommented, Oct 9, 2017

I’d say you’re not using sbt properly.

If you want to directly launch sbt and pass a full command as a parameter, you have to wrap it with double quotes: sbt "gatling-it:testOnly com.mycompany.myapp.TestB".

Or go in interactive mode:

sbt
> gatling-it:testOnly com.mycompany.myapp.TestB
3reactions
bartkummelcommented, Oct 9, 2017

I guess you’re right. That’s a nasty problem in SBT then. I’d say testOnly should throw an error when it doesn’t get an argument. But that’s not of your concern of course. 😉 Thanks for helping me out!

Read more comments on GitHub >

github_iconTop Results From Across the Web

unit testing - sbt testOnly not working - Stack Overflow
Using testOnly within sbt I can write whatever I feel like and still always get the same response. Running all tests work fine....
Read more >
test-only runs all tests in all projects if invoked directly ... - GitHub
If I run sbt test-only *SingleTestSuite from the command line with a multi module project, then sbt actually runs all the tests in...
Read more >
sbt Reference Manual — Testing
The tasks for running tests are test and testOnly . The test task accepts no command line arguments and runs all tests: >...
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 test does not actually run any tests - Play Framework
I've been running tests mostly in IDEs (both Eclipse and IntelliJ) and they both work fine. However, I've noticed that if I try...
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