Re: sbt testOnly command line for running exactly one integration test?

2021-05-11 Thread Steve Lawrence
Might be an issue with using the old sbt syntax? Old syntax should work,
I think it's only deprecated, but the new syntax is:

 sbt IntegrationTest/testOnly ...

Also, integration tests are only in the CLI subproject, so things can be
a small bit quicker if you specify that, e.g.

  sbt daffodil-cli/IntegrationTest/testOnly ..

Lastly, sbt views each space separated thing as new sbt command, so if
your command has spaces in it, like you usually want with testOnly, then
you need to wrap it in quotes, e.g.

  sbt "daffodil-cli/IntegrationTest/testOnly
org.apache.daffodil.foo.TestSuite -- --tests=test_that_you_care_about"

The integration tests literally execute the CLI, so there's no way to
get around staging jars without a fundamental change in how we test. We
could maybe consider changing our CLI tests so that they call the main()
function in org.apache.daffodil.Main. That would avoid the need to stage
things. But we'd need to figure out how to capture stdin/stdout for each
unique run. Maybe each test would need a separate fork, which sbt can
do? I think we would also need to move away from expect since I think
that essentially spawns a shell and then provides input/output.

I've also wondered if there's a away to sort of share the process space
or JVM. I imagine respawning the JVM for every integration test it what
causes the majority of the slowness for the CLI tests. Would be nice if
we could spawn a single JVM and share it among different daffodil
executions. I'm not sure if anything like that exists.


On 5/11/21 9:47 AM, Beckerle, Mike wrote:
> I am wasting a bunch of time because just two integration tests are failing 
> in 
> my current work.
> 
> I can't get 'sbt it:testOnly ... ' to work.
> 
> I've used sbt testOnly before with regular tests.
> 
> Can it be made to work for integration tests?
> 
> I've asked questions about sbt testOnly before. This time I will make an sbt 
> notes wiki page.
> 
> Second issue: the build-test-rebuild-test cycle for integration tests is 
> terribly long.
> 
> Can one shortcut the full 'sbt stage' operation that makes the doc jars and 
> such, e.g., is there a sub-operation that just refreshes the code jars?
> 
> 
> Mike Beckerle | Principal Engineer
> 
> mbecke...@owlcyberdefense.com 
> 
> P +1-781-330-0412
> 



sbt testOnly command line for running exactly one integration test?

2021-05-11 Thread Beckerle, Mike
I am wasting a bunch of time because just two integration tests are failing in 
my current work.

I can't get 'sbt it:testOnly ... ' to work.

I've used sbt testOnly before with regular tests.

Can it be made to work for integration tests?

I've asked questions about sbt testOnly before. This time I will make an sbt 
notes wiki page.

Second issue: the build-test-rebuild-test cycle for integration tests is 
terribly long.

Can one shortcut the full 'sbt stage' operation that makes the doc jars and 
such, e.g., is there a sub-operation that just refreshes the code jars?


Mike Beckerle | Principal Engineer

[cid:055ceb22-3135-4a39-b05f-6f75286db035]

mbecke...@owlcyberdefense.com

P +1-781-330-0412