zinc
zinc copied to clipboard
Document how to enable debug info on scripted tests and/or make it much simpler
This is the process currently:
- Edit https://github.com/sbt/zinc/blob/1.0/project/Scripted.scala
- At the end of the file, replace
bridge.run(sourcePath, true, args.toArray)
by
bridge.run(sourcePath, false, args.toArray)
In my opinion, this should be the default option. What do you think @eed3si9n @dwijnand?
I think the problem is that if we dumped the debug log without buffering, it will end up flooding Travis CI. We should print out the log when it the test fails.
Sometimes it's useful to print the logs when the test doesn't fail for debugging purpose too.
In scripted plugin there's a setting for it actually. We should probably that over.
I think we could dump the debug log in the following situations:
- Test fails.
- User adds a name of a scripted test to a setting in the build that enables debugging for that scripted test.
If all this is possible, that's perfect.
User adds a name of a scripted test to a setting in the build that enables debugging for that scripted test.
That requires reloading the build which is always annoying, and you have to remember to not commit that change, I'd like to be able to do something like debugScripted a/b in sbt instead.
User adds a name of a scripted test to a setting in the build that enables debugging for that scripted test.
I actually misread Jorge's comment above before giving 👍 . I thought it would automatically dump the log if the scripted is invoked as scripted a/b.
Oh, that's fine too. Actually it's a better solution.
Okay, thinking out loud here. As scripted failures are most of the times unexpected and we're only interested in seeing the logs when a scripted test fail, I think the best thing to do is to enrich Zinc's scripted implementation to compress the contents of the failed scripted working directory and make it available somewhere for further inspection. These contents should also contain the scripted logs.
The "make it available somewhere for further inspection" can be fancy, in the future. For example, we could upload a zip somewhere in the internet so that we can see what went wrong in the CI without re-running scripted tests. However, we can start small here by doing it locally at the beginning: putting the contents in the temporary directory and printing its absolute path.
Does this make sense? Pros? Cons?