Skip to content
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

Fix JUnit 5 tests when overriding test harness #685

Merged
merged 1 commit into from
Jul 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/main/java/org/jenkins/tools/test/hook/Jetty12Hook.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,15 @@ private VersionNumber getWinstoneVersion(File war) {
throw new UncheckedIOException("Failed to read Winstone version in " + war, e);
}
}

@Override
public void action(@NonNull BeforeExecutionContext context) {
super.action(context);
/*
* The version of JUnit 5 used at runtime must match the version of JUnit 5 used to compile the tests, but the
* inclusion of a newer test harness might cause the HPI plugin to try to use a newer version of JUnit 5 at
* runtime to satisfy upper bounds checks, so exclude JUnit 5 from upper bounds analysis.
*/
context.getArgs().add("-DupperBoundsExcludes=org.junit.jupiter:junit-jupiter-api");
}
}