These are chat archives for etorreborre/specs2

10th
Nov 2017
Marko Dimjašević
@mdimjasevic
Nov 10 2017 09:30
Howdy!
I'm using ScalaCheck via Specs2. How do I specify in build.sbt the minimum number of test cases that have to be successful?
I tried with something like this, but that didn't work: Tests.Argument(TestFrameworks.Specs2, "minTestsOk", "10")
Marko Dimjašević
@mdimjasevic
Nov 10 2017 10:12
If it helps, I'm working with specs2 3.8.6
Eric Torreborre
@etorreborre
Nov 10 2017 11:03
it is "scalacheck.mintestsok"
Marko Dimjašević
@mdimjasevic
Nov 10 2017 11:45
@etorreborre : with or without a dash in front?
Eric Torreborre
@etorreborre
Nov 10 2017 11:46
without
Marko Dimjašević
@mdimjasevic
Nov 10 2017 11:46
So this would be a full line? Tests.Argument(TestFrameworks.Specs2, "scalacheck.minTestsOk", "10")
Eric Torreborre
@etorreborre
Nov 10 2017 11:47
yes that should work
Marko Dimjašević
@mdimjasevic
Nov 10 2017 11:49
Hm, not working for me. I'm at 3.8.6, as mentioned before
Eric Torreborre
@etorreborre
Nov 10 2017 11:51
I don't think this syntax has changed in a long time. Can you please try directly from sbt? sbt> testOnly *MySpec -- scalacheck.minTestsOk 10
Marko Dimjašević
@mdimjasevic
Nov 10 2017 12:12
@etorreborre : I just tried it and no, it's not taking 10 as the number of successful test cases
Eric Torreborre
@etorreborre
Nov 10 2017 12:27
can you test that again and remove your Tests.Arguments? Just to make sure they are not interferring
also do you have a project reproducing the issue?
Marko Dimjašević
@mdimjasevic
Nov 10 2017 12:32
Working on it. Unfortunately, the project at work that I'm working on is not publicly available
Eric Torreborre
@etorreborre
Nov 10 2017 12:33
I guessed so
Marko Dimjašević
@mdimjasevic
Nov 10 2017 12:33
So yes, even after removing Tests.Argument from build.sbt, the same thing. Should it have been Tests.Arguments?
i.e. Argument vs Arguments
Eric Torreborre
@etorreborre
Nov 10 2017 12:34
what I mean is that you should make sure that you don't set anything in sbt for specs2 and then test on the command line only
I don't remember the exact sbt syntax
Marko Dimjašević
@mdimjasevic
Nov 10 2017 12:34
if it matters, in build.sbt I also have this: Tests.Argument(TestFrameworks.ScalaCheck, "-minSuccessfulTests", someIntegerValue)
Eric Torreborre
@etorreborre
Nov 10 2017 12:37
I don't think that should influence the way things are executed from specs2 but I would just remove as well to make sure
Marko Dimjašević
@mdimjasevic
Nov 10 2017 12:37
I just did and still 100 test cases get executed
Eric Torreborre
@etorreborre
Nov 10 2017 12:37
:-( something else is not playing nice. I have no idea from here
Marko Dimjašević
@mdimjasevic
Nov 10 2017 12:38
Is there a way for me to debug this, e.g., by enabling a verbosity flag?
Eric Torreborre
@etorreborre
Nov 10 2017 12:39
not really. Your best bet is to fire-up Intellij and pass -Dscalacheck.mintestsok=10 as a jvm property and step through in specs2 code
hmm that might actually work because this is not the same code path as sbt
you should actually debug using the org.specs2.runner.sbtRun object
I'm stepping out for lunch for a bit
Marko Dimjašević
@mdimjasevic
Nov 10 2017 12:42
thanks for your help and enjoy your lunch!
Andreas Flierl
@asflierl
Nov 10 2017 14:27
@etorreborre have you noticed that the TOC is no longer written to the HTML reports for quite a while? passing the argument "html.toc" to SBT just results in a "<toc/>" tag appearing in the HTML, but the replacing done by SpecHtmlPage#addToc no longer seems to happen
Eric Torreborre
@etorreborre
Nov 10 2017 14:28
I just used it and it worked ok for me this morning: https://zalando.github.io/grafter/org.zalando.grafter.CreateSingletons.html
With 4.0.1
Andreas Flierl
@asflierl
Nov 10 2017 14:31
using 4.0.1 as well (on Windows though)
but this is happening since at least 3.9.x
Eric Torreborre
@etorreborre
Nov 10 2017 14:39
that being said I had some issues this morning with my main spec not being created in the right directory after changing html.outdir. The toc I pasted above is included for specs linked from the main one. I will investigate that
Eric Torreborre
@etorreborre
Nov 10 2017 14:46
and everything works fine if I test a small example from inside specs2
Works fine as well if I test from another project
Andreas Flierl
@asflierl
Nov 10 2017 14:49
I'll try with something at home later. All the projects I have here on Windows have this issue.
Eric Torreborre
@etorreborre
Nov 10 2017 15:02
ok I know what was wrong for me this morning, I was overriding the html options in my top specification. So that doesn't explain why you are having some issues
Andreas Flierl
@asflierl
Nov 10 2017 21:02
OK. getting no TOC on OS X neither - specs 3.9.4 or 4.0.1 same difference… I must be doing some configuration wrong but can't figure it out
Andreas Flierl
@asflierl
Nov 10 2017 21:22
do I need pandoc to get a toc?