Skip to content

Commit

Permalink
Add a step to the CI build that fails on warnings in the functional t…
Browse files Browse the repository at this point in the history
…ests (doesn't fail the build)
  • Loading branch information
eyalroth committed Aug 28, 2021
1 parent 2cc7085 commit 6d99342
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@ jobs:
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew --info --stacktrace check
- name: Fail on warning
run: ./gradlew --info --stacktrace check --warning-mode=fail -PfailOnWarning
continue-on-error: true
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ task functionalTest(type: Test) {
showStandardStreams = System.env.CI == 'true'
}

systemProperty 'failOnWarning', project.hasProperty('failOnWarning')

mustRunAfter crossScalaVersionTest
}
check.dependsOn functionalTest
Expand Down Expand Up @@ -206,4 +208,4 @@ idea.project.settings {
taskTriggers {
beforeBuild fixIdeaPluginClasspath, pluginUnderTestMetadata
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,11 @@ private void configureArguments(String... arguments) {
fullArguments.add("-PjunitVersion=5.3.2");
fullArguments.add("-PjunitPlatformVersion=1.3.2");
fullArguments.add("-PscalatestVersion=3.0.8");
fullArguments.add("--warning-mode=all");
if (Boolean.parseBoolean(System.getProperty("failOnWarning"))) {
fullArguments.add("--warning-mode=fail");
} else {
fullArguments.add("--warning-mode=all");
}
fullArguments.addAll(Arrays.asList(arguments));

runner.withArguments(fullArguments);
Expand Down

0 comments on commit 6d99342

Please sign in to comment.