-
Notifications
You must be signed in to change notification settings - Fork 0
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
Surefire test filtering support #1
base: feature/issue-641-tooling-tests
Are you sure you want to change the base?
Surefire test filtering support #1
Conversation
@@ -46,23 +51,19 @@ test { | |||
|
|||
shadowJar { | |||
exclude 'META-INF/maven/**' | |||
|
|||
dependencies { |
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.
Certain dependencies (e.g. junitPlatformLaungher
) are needed with their original (unshadowed) package names (see why here and here)
The changes made to the shadowJar
config, as well as disabling both checkExportedPackage
and checkArtifact
, was the only way I managed to get it work. Leaving the current config resulted in a bunch of ClassNotFoundException
s in tests, because the classes from junitPlatformLauncher
, surefireApi
etc. would, unsurprisingly, not be found on the runtime test classpath.
Please advise on how this requirement should properly be handled. If the packages absolutely must be shadowed, I can introduce a proxy at runtime, but that just adds unnecessary complexity IMHO.
PostDiscoveryFilter postDiscoveryFilter = findPostDiscoveryFilter(request); | ||
PostDiscoveryFilter replacement = initialize(postDiscoveryFilter); | ||
if (replacement != postDiscoveryFilter) { | ||
replaceFilter(request, postDiscoveryFilter, replacement); |
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.
This if
statement is not yet used (will be needed for Gradle filtering)
try { | ||
if (SurefireTestNameFilter.appliesTo(discoveryRequest)) { | ||
return new SurefireTestNameFilter(discoveryRequest); | ||
} |
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.
Another else if
branch could essentially be added here if we also want to introduce a filter based on custom ArchUnit properties, like the ticket suggests
d4d6021
to
d1cea3d
Compare
d1cea3d
to
8364e32
Compare
Signed-off-by: Krzysztof Sierszeń krzysztof.sierszen@digitalnewagency.com