Skip to content

Commit

Permalink
Fix JUnit 5 tests when overriding test harness (#685)
Browse files Browse the repository at this point in the history
  • Loading branch information
basil committed Jul 10, 2024
1 parent a942d00 commit 17b4300
Showing 1 changed file with 11 additions and 0 deletions.
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");
}

Check warning on line 76 in src/main/java/org/jenkins/tools/test/hook/Jetty12Hook.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered lines

Lines 31-76 are not covered by tests
}

0 comments on commit 17b4300

Please sign in to comment.