-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Add ConsoleLauncher option to print discovery result #3164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
3258b66
to
f5f0da3
Compare
How shell script friendly is this command? Can do something like:
|
Dear @marcphilipp, Thank You very much for implementing this feature. It is amazing. I tried it a bit and found mismatches between the results of test discovery and test execution for the parameterized tests: 1 test after discovery and 4 tests after execution. It could be done by design. JDK: java -version
openjdk version "17.0.6" 2023-01-17 LTS
OpenJDK Runtime Environment Corretto-17.0.6.10.1 (build 17.0.6+10-LTS)
OpenJDK 64-Bit Server VM Corretto-17.0.6.10.1 (build 17.0.6+10-LTS, mixed mode, sharing)
Test code: import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;
class MavenExampleTest {
@Test
void shouldRun() {}
@ParameterizedTest
@ValueSource(strings = { "racecar", "radar", "able was I ere I saw elba" })
void palindromes(String candidate){}
} Test discovery:
Test execution:
|
That's to be expected. During the discovery phase only "static" tests can be detected. This means that you won't see dynamic test invocations or parameterized test invocations counted as tests during discovery, but you will see them during the execution phase. |
This commit adds a getter for TestPlan's 'allIdentifiers' field. Issue: #111
Executing 'java -jar junit.jar -cp "./test/" --list-tests' will return ╷ ├─ JUnit Vintage ↷ ├─ CarTest ↷ │ ├─ testModel() ↷ │ └─ testMake() ↷ └─ JUnit Jupiter ↷ Issue: #2854
The purpose of this interface is to be able to extend the 3 different details printing listeners which inherit TestExecutionListener: * TreePrintingListener * VerboseTreePrintingListener * FlatPrinting Listener Issue: #2854
When listing tests, the TreePrinter assumes the test is skipped and adds the '↷' symbol. If the test has no duration, result and reason, it is assumed the test is just being listed and the '↷' is omitted. Issue: #2854
All previous commits are connected and the feature is working. Issue: #2854
Pull request: #2870
Pull request: #2870
1b628f1
to
753c88f
Compare
180b92b
to
46930ab
Compare
The new `--list-tests` option prints the result of test discovery. Resolves junit-team#2854. Co-authored-by: stoyanK7 <stoyank127@gmail.com>
Overview
I hereby agree to the terms of the JUnit Contributor License Agreement.
Definition of Done
@API
annotationsChange is documented in the User Guide and Release Noteswill be done in Introduce subcommands forConsoleLauncher
#3243