-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Introduce junit-platform-suite-engine #2416
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
Merged
marcphilipp
merged 43 commits into
junit-team:main
from
mpkorstanje:junit-platform-suite-engine
Feb 9, 2021
Merged
Changes from 40 commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
153b348
Implement junit-platform-suite-engine
mpkorstanje dd009ac
Apply review comments
mpkorstanje c7ad80f
Pass parentId along with discovery selection
mpkorstanje a82d550
Document the junit platform suite engine
mpkorstanje e21db43
Use more distance for cross package connections
mpkorstanje 30379d7
Explain that test descriptors in the discovery result can be used as …
mpkorstanje 9a15714
Reference correct group id in java doc
mpkorstanje d5d816d
Spotless
mpkorstanje 354a47b
Merge remote-tracking branch 'origin/main' into junit-platform-suite-…
mpkorstanje c9e76fb
Consistently use fqn package names in @API(consumer) field
mpkorstanje 3662638
Fix warnings on OpenJDK 17.
mpkorstanje 1a6c97c
Move selector variations to DiscoverySelectors
mpkorstanje 757977e
Reduce repetition
mpkorstanje f9a1f7b
Untangle SuiteDiscoveryRequestBuilder from LauncherDiscoveryRequestBu…
mpkorstanje bb86ebe
Use standard include patterns when IncludeClassNamePatterns is omitted
mpkorstanje f0cb4e2
Reuse SuiteLauncherDiscoveryRequestBuilder through duplication
mpkorstanje 2a8d843
Remove duplication from suite-api-documentation
mpkorstanje 9113788
Extract SuiteLauncherDiscoveryRequestBuilder to junit-platform-suite-…
mpkorstanje fabc3a3
Add junit-platform-suite-commons to dependency diagram
mpkorstanje 5500c67
Clean up accessors
mpkorstanje 32fe7e4
Clean up naming
mpkorstanje 0d9f9d8
Update dependency list in docs
mpkorstanje e02608b
Support meta annotations
mpkorstanje f11f18e
Fix update documentation check
mpkorstanje aa7befa
Nits
mpkorstanje f4f4b0d
Nits
mpkorstanje 5f7328a
Use delegation to keep purpose of suite request builder clear
mpkorstanje c59900f
Add test for meta-annotations
mpkorstanje a0e92f0
Fix java doc
mpkorstanje 659f71c
Fix release notes
mpkorstanje dbe8cb0
Nits
mpkorstanje 89dc3d5
Keep apiguardian as a transitive dependency
mpkorstanje 10cfe8d
Merge remote-tracking branch 'origin/main' into junit-platform-suite-…
mpkorstanje 2d1b7d1
Update junit-platform-suite-api/src/main/java/org/junit/platform/suit…
mpkorstanje 7749b90
Update junit-platform-launcher/src/main/java/org/junit/platform/launc…
mpkorstanje 01a611a
Update junit-platform-engine/src/main/java/org/junit/platform/engine/…
mpkorstanje 8723325
Update documentation/src/docs/asciidoc/release-notes/release-notes-5.…
mpkorstanje da654f2
Update junit-platform-suite-engine/src/main/java/org/junit/platform/s…
mpkorstanje 4ade1c4
Rename Configuration to ConfigurationParameter
mpkorstanje 94e47a2
Only discover test in suit for engines direct descendents
mpkorstanje a7bb955
Delay prune until after suits have been discovered
mpkorstanje 6b4a1f3
Add note about aggregator
mpkorstanje b9911f6
Use note styling
mpkorstanje File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,8 @@ | |
|
||
include::launcher-api.adoc[] | ||
|
||
include::junit-platform-suite-engine.adoc[] | ||
|
||
include::testkit.adoc[] | ||
|
||
//// | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
documentation/src/docs/asciidoc/user-guide/junit-platform-suite-engine.adoc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
[[junit-platform-suite-engine]] | ||
=== JUnit Platform Suite Engine | ||
|
||
The JUnit Platform supports declarative definition and execution of suites of tests from | ||
_any_ test engine using the Junit Platform. | ||
|
||
==== Setup | ||
|
||
In addition to _at least one_ other test engine, you need the following artifacts and | ||
their dependencies on the classpath. See <<dependency-metadata>> for details regarding | ||
group IDs, artifact IDs, and versions. | ||
|
||
===== Explicit Dependencies | ||
|
||
* `junit-platform-suite-api` in _test_ scope | ||
* `junit-platform-suite-engine` in _test runtime_ scope: implementation of the | ||
`TestEngine` API for the declarative Junit Platform | ||
Suites | ||
marcphilipp marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
===== Transitive Dependencies | ||
|
||
* `junit-platform-suite-commons` in _test_ scope | ||
* `junit-platform-launcher` in _test_ scope | ||
* `junit-platform-engine` in _test_ scope | ||
* `junit-platform-commons` in _test_ scope | ||
* `opentest4j` in _test_ scope | ||
|
||
==== Test Suite | ||
|
||
By annotating a class with `@Suite` it is marked as a test suite on the JUnit Platform. | ||
As seen in the following example, selector and filter annotations can then be used to | ||
control the contents of the suite. | ||
|
||
[source,java,indent=0] | ||
---- | ||
include::{testDir}/example/SuiteDemo.java[tags=user_guide] | ||
---- | ||
|
||
.Additional Configuration Options | ||
mpkorstanje marked this conversation as resolved.
Show resolved
Hide resolved
|
||
NOTE: There are more configuration options for discovering and filtering tests than just | ||
`@SelectPackages`. Please consult the Javadoc of the `{suite-api-package}` package for | ||
further details. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* Copyright 2015-2021 the original author or authors. | ||
* | ||
* All rights reserved. This program and the accompanying materials are | ||
* made available under the terms of the Eclipse Public License v2.0 which | ||
* accompanies this distribution and is available at | ||
* | ||
* https://www.eclipse.org/legal/epl-v20.html | ||
*/ | ||
|
||
package example; | ||
|
||
//tag::user_guide[] | ||
import org.junit.platform.suite.api.SelectPackages; | ||
import org.junit.platform.suite.api.Suite; | ||
import org.junit.platform.suite.api.SuiteDisplayName; | ||
|
||
@Suite | ||
@SuiteDisplayName("JUnit Platform Suite Demo") | ||
@SelectPackages("example") | ||
//end::user_guide[] | ||
@org.junit.platform.suite.api.ExcludeTags("exclude") | ||
//tag::user_guide[] | ||
public class SuiteDemo { | ||
} | ||
//end::user_guide[] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've intentionally removed the reference to other test engines. Looking at the current implementations I don't think it is feasible for other test engines to replicate this functionality without using JUnits internals.