maiflai / gradle-scalatest

A plugin to enable the use of scalatest in a gradle Scala project.
The Unlicense
73 stars 35 forks source link

Specifying reporters #87

Closed atais closed 4 years ago

atais commented 4 years ago

Hello again,

sorry I am new in gradle so this might be simple but I cannot find a way to specify a reporter.

The only config I can see is: https://github.com/maiflai/gradle-scalatest#configmap which linked to: https://www.scalatest.org/user_guide/using_the_runner#configMapSection

however I am trying to use this section: https://www.scalatest.org/user_guide/using_the_runner#specifyingReporters

i.e. I want to add a reporter class

-C[configs...] <reporterclass> - causes test results to be reported to an instance of the specified fully qualified Reporter class name

and config map is not the way I believe. Thanks in advance.

I know sbt and maven way 👍

Test / testOptions += Tests.Argument("-C", "org.company.SampleClass"),
<plugin>
    <groupId>org.scalatest</groupId>
    <artifactId>scalatest-maven-plugin</artifactId>
    <configuration>
        <reporters>org.company.SampleClass</reporters>
    </configuration>
</plugin>
maiflai commented 4 years ago

sorry, this isn't currently supported - what reporter are you trying to add please?

atais commented 4 years ago

It is a custom in-house reporter provided by external jar, so passing a class would be the ideal solution

maiflai commented 4 years ago

please could you try version 0.27?

atais commented 4 years ago
Exception in thread "ScalaTest-main" java.lang.IllegalArgumentException: ERROR: -c has been deprecated for a very long time and is no longer supported, to prepare for reusing it for a different purpose in the near future. Please change all uses of -c to -P.
        at org.scalatest.tools.ArgsParser$.checkArgsForValidity(ArgsParser.scala:46)
        at org.scalatest.tools.Runner$.runOptionallyWithPassFailReporter(Runner.scala:805)
        at org.scalatest.tools.Runner$.main(Runner.scala:775)
        at org.scalatest.tools.Runner.main(Runner.scala)

should be -C not -c :( thanks for quick response!

maiflai commented 4 years ago

sorry, 0.28?

atais commented 4 years ago

no... why did you change -c into -P

this is completely other option

P[S][integer thread count] - specifies a parallel run, with optional suite sorting and thread count(Note: only one -P allowed)

it should be -C - capital C, as I wrote before.

maiflai commented 4 years ago

sorry, sorry...

0.29? I have actually checked the reporter now.

atais commented 4 years ago

🎆 🎆 🍾 thanks!

ankiiitraj commented 2 years ago

hi @maiflai @atais if I need to pass custom reporter from scalatest maven plugin. How to do that?

sorry for asking in Gradle :p

maiflai commented 2 years ago

I'm sorry - I don't know anything about the maven plugin.

Have you tried the suggestion in the very first post of this thread?