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

Suggest putting jupiter on runtime only #2021

Merged
merged 5 commits into from
Jan 11, 2022
Merged
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions changelog/@unreleased/pr-2021.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
type: improvement
improvement:
description: Upon missing jupiter on classpath, suggest putting it on runtime rather
than implementation to avoid making checkUnusedDependenciesTest fail in return.
links:
- https://github.com/palantir/gradle-baseline/pull/2021
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ private void validateSourceSet(SourceSet ss, Test task) {
// org.junit.jupiter.api.Test annotation, but as JUnit4 knows nothing about these, they'll silently not run
// unless the user has wired up the dependency correctly.
if (sourceSetMentionsJUnit5Api(ss)) {
String implementation = ss.getImplementationConfigurationName();
String runtime = ss.getRuntimeClasspathConfigurationName();
Preconditions.checkState(
junitPlatformEnabled,
"Some tests mention JUnit5, but the '"
Expand All @@ -102,7 +102,7 @@ private void validateSourceSet(SourceSet ss, Test task) {
+ "useJUnitPlatform() enabled. This means tests may be silently not running! Please "
+ "add the following:\n\n"
+ " "
+ implementation
+ runtime
+ " 'org.junit.jupiter:junit-jupiter'\n");
}

Expand Down