Comments (11)
That's odd - taking https://github.com/xanderdunn/reinforcementLearning as an example I find that test
runs 1 test which passes.
When I uncomment the second test in src/test/scala/ticTacToeTests.scala
it runs and fails:
:test
Discovery starting.
Discovery completed in 126 milliseconds.
Run starting. Expected test count is: 2
TicTacToeSpec:
Tic-tac-toe learning
NeuralNetSpec:
A NeuralNet
- should have greater than 79.0% X wins for Neural Net vs. Random (11 minutes, 56 seconds)
+ X won 88.485% of games
- should have greater than 90% stalemates for Neural vs. Neural *** FAILED *** (12 minutes, 29 seconds)
0.0 was not greater than 0.9 (ticTacToeTests.scala:79)
Run completed in 12 minutes, 29 seconds.
Total number of tests run: 2
Suites: completed 3, aborted 0
Tests: succeeded 1, failed 1, canceled 0, ignored 0, pending 0
*** 1 TEST FAILED ***
TicTacToeSpec:
Tic-tac-toe learning
- should have greater than 90% stalemates for Neural vs. Neural *** FAILED *** (12 minutes, 29 seconds)
0.0 was not greater than 0.9 (ticTacToeTests.scala:79)
:test FAILED
Is this an appropriate repository to use as a working example? If so, please could you push any updates and I'll see if I can reproduce the problem.
from gradle-scalatest.
Yeah, I get the same results that you do for master on GitHub.
I've pushed my changes to the unitTests branch. With this code, I run gradle clean && gradle test
and it outputs:
:test
Discovery starting.
Discovery completed in 94 milliseconds.
Run starting. Expected test count is: 2
Run completed in 156 milliseconds.
Total number of tests run: 0
Suites: completed 1, aborted 0
Tests: succeeded 0, failed 0, canceled 0, ignored 0, pending 0
No tests were executed.
BUILD SUCCESSFUL
The most significant difference related to unit tests that I can think of is that I created custom tag classes and tagged all of my unit tests. If I remove the exclude tag lines from my build.gradle, then it runs all the tests as expected.
Thanks a lot for your help!
from gradle-scalatest.
Sorry - is this a typo?
I think you mean that you want to include org.scalatest.tags.UnitTest
, but the currentbuild.gradle
marks them as exclude.
Perhaps this is what it should be?
test {
tags {
include 'org.scalatest.tags.UnitTest' // include Unit
exclude 'org.scalatest.tags.CoverageAcceptanceTest' // exclude Coverage
}
}
I guess that scalatest is reporting a single suite to indicate the wrapping suite (the DiscoverySuite
).
from gradle-scalatest.
No, this is not a typo. I have two test targets: test and testScoverage.
I want test to run nothing but those tests with the tag NonCoverageAcceptanceTest. Hence, I excluded all other test tags.
I want testScoverage to run those tests tagged CoverageAcceptanceTest or UnitTest.
from gradle-scalatest.
Hmm - yes - from the documentation I see that:
If tags to include is not specified, then all tests except those mentioned in the tags to exclude (and in the org.scalatest.Ignore tag), will be executed
So I agree that excluding those two tags should have the desired effect.
I am however getting very strange results running the tests by hand (i.e. without Gradle).
Scalatest appears to randomly detect tests when using the PS
argument which is intended to enable parallel execution of Suites (I notice that you are using ParallelTestExecution
in order to enable this at a test level rather than Suite).
gradle clean test -i
prints the command line before running the test. Can you remove the PS
argument locally, run the command and see if this helps? Unfortunately PS
is always specified, it's just the number which can currently be controlled...
from gradle-scalatest.
And it seems that Pn
works, it's just PSn
that doesn't.
Sorry, I'll have to pick this up tomorrow, I suspect it will require an update to the plugin.
Please could you confirm these findings if you get a mo?
Thanks,
Stu
from gradle-scalatest.
I reviewed the git log - PS
is used to ensure that the tests are reported in a sane manner when they are run in parallel. I don't think I can remove it.
I did remove the use of ParallelTestExecution
in your tests and the build seems to fail reliably. Are you ok with this workaround?
I think this is actually an issue in the underlying scalatest library. I imagine you'd rather continue with working on the problem you're trying to solve, rather than debugging a tool? I'm happy to chase this down with the scalatest guys, unless you fancy it...
Cheers,
Stu
from gradle-scalatest.
@maiflai Thanks so much for your help! Yeah, this is very helpful. It's a huge performance gain for me to be able to run the tests in parallel, but as a temporary workaround I'll run them without ParallelTestExecution
.
It would be awesome if you followed up with the scalatest team, thanks!
Since this doesn't appear to be an issue with gradle-scalatest, shall I close this?
from gradle-scalatest.
Thanks - closing this issue now that I've raised scalatest/scalatest#706
from gradle-scalatest.
@maiflai Thanks!
from gradle-scalatest.
Greetings. I know this issue was closed almost 5 years ago, but it is currently a thorn in our side. And still a problem even with Scalatest 3.2.0. I think we'd be happy just risking it with -P instead of -PS. @maiflai Any way to get that with the current version 0.26? Or would that require a code change?
Thanks.
from gradle-scalatest.
Related Issues (20)
- Argument list too long with gradle-scalatest plugin enabled.
- Could not find method tags() HOT 6
- No license in Maven artifacts
- Gradle 5.5 Caused by: groovy.lang.GroovyRuntimeException: Could not find matching constructor HOT 1
- An exception or error caused a run to abort. This may have been caused by a problematic custom reporter. HOT 3
- Test filtering HOT 3
- Add support to gradle 8 HOT 1
- Gradle 8.4 support? HOT 4
- Support gradle configuration cache
- java.lang.ClassNotFoundException: com.vladsch.flexmark.ast.Node HOT 1
- How do I pass `-Dfile.encoding=UTF-8` to the jvm running ScalaTest? HOT 1
- Multiple -R arguments when using testClassesDir HOT 4
- Equivalent of `-u build/test-reports` ? HOT 4
- IDEA console ANSI color render HOT 2
- Plugin is incompatible with Gradle 7 HOT 11
- Version 0.31 is not properly published HOT 3
- Support for scalaCheck HOT 1
- Switch away from methods deprecated in Gradle 7.
- Add ability to set custom runner from config
- Feature request: replace `ScalaTestAction` with Gradle native test actions HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gradle-scalatest.