Hello,
this post is may be interesting for CAS contributors...
Note that I'm intentionally leaving just the necessary command line parameters in the examples below in order to keep it short.
1) Running tests just from one module is not possible
This is not documented, yet it is working in 6.2.x. For example:
$ ./gradlew :core:cas-server-core-authentication {cleanTest,testSimple} --info
Unexpected result:
...
> Task :core:cas-server-core-authentication:testSimple SKIPPED
Skipping task ':core:cas-server-core-authentication:testSimple' as task onlyIf is false.
:core:cas-server-core-authentication:testSimple (Thread[Execution worker for ':',5,main]) completed. Took 0.0 secs.
2) Running a single test is not possible
For example (note that the `--category` switch seems to be mandatory, there is probably some technical reason behind always filtering tests by their `@Tag` annotation):
$ ./testcas.sh --category simple --test org.apereo.cas.authentication.handler.ConvertCasePrincipalNameTransformerTests
... which runs:
$ ./gradlew cleanTest testSimple --tests "org.apereo.cas.authentication.handler.ConvertCasePrincipalNameTransformerTests"
Unexpected result:
> Task :api:cas-server-core-api-configuration-model:testSimple FAILED
Started running test suite [Gradle Test Run :api:cas-server-core-api-configuration-model:testSimple] @ Sat Apr 03 11:31:45 CEST 2021
Results for test suite [Gradle Test Run :api:cas-server-core-api-configuration-model:testSimple]: SUCCESS @ Sat Apr 03 11:31:45 CEST 2021
(0 tests, 0 successes, 0 failures, 0 skipped)
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':api:cas-server-core-api-configuration-model:testSimple'.
---
I tried to comment out various suspicious parts within the "cas/gradle/tests.gradle" file and also passing various switches to the Gradle build, but nothing worked so far.
So can anybody help with this? Until then, launching just selected tests from within IDEA, via its JUnits runner, seems to be the working way, and maybe that this could also be recommended for launching tests in an ad-hoc style in the CAS docs?