Skip to content

Commit 2761bb2

Browse files
committed
Add a step to the CI build that fails on warnings in the functional tests (doesn't fail the build)
1 parent 2cc7085 commit 2761bb2

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

.github/workflows/gradle.yml

+9-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@ on:
1111

1212
jobs:
1313
build:
14+
strategy:
15+
matrix:
16+
include:
17+
- additional-check-args: ''
18+
continue-on-error: false
19+
- additional-check-args: '--warning-mode=fail -PfailOnWarning'
20+
continue-on-error: true
1421

1522
runs-on: ubuntu-latest
1623

@@ -24,4 +31,5 @@ jobs:
2431
- name: Grant execute permission for gradlew
2532
run: chmod +x gradlew
2633
- name: Build with Gradle
27-
run: ./gradlew --info --stacktrace check
34+
run: ./gradlew --info --stacktrace check ${{ matrix.additional-check-args }}
35+
continue-on-error: ${{ matrix.continue-on-error }}

build.gradle

+3-1
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ task functionalTest(type: Test) {
104104
showStandardStreams = System.env.CI == 'true'
105105
}
106106

107+
systemProperty 'failOnWarning', project.hasProperty('failOnWarning')
108+
107109
mustRunAfter crossScalaVersionTest
108110
}
109111
check.dependsOn functionalTest
@@ -206,4 +208,4 @@ idea.project.settings {
206208
taskTriggers {
207209
beforeBuild fixIdeaPluginClasspath, pluginUnderTestMetadata
208210
}
209-
}
211+
}

src/functionalTest/java/org/scoverage/ScoverageFunctionalTest.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,11 @@ private void configureArguments(String... arguments) {
127127
fullArguments.add("-PjunitVersion=5.3.2");
128128
fullArguments.add("-PjunitPlatformVersion=1.3.2");
129129
fullArguments.add("-PscalatestVersion=3.0.8");
130-
fullArguments.add("--warning-mode=all");
130+
if (Boolean.parseBoolean(System.getProperty("failOnWarning"))) {
131+
fullArguments.add("--warning-mode=fail");
132+
} else {
133+
fullArguments.add("--warning-mode=all");
134+
}
131135
fullArguments.addAll(Arrays.asList(arguments));
132136

133137
runner.withArguments(fullArguments);

0 commit comments

Comments
 (0)