You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
There are 2 bugs in code-coverage.gradle:
When running ./gradlew check -Dtests.coverage=true, the following error occurs:
Suite: Test class org.opensearch.test.loggerusage.OpenSearchLoggerUsageTests
2> java.lang.RuntimeException: unable to install test security manager
at org.opensearch.bootstrap.BootstrapForTesting.<clinit>(BootstrapForTesting.java:190)
at org.opensearch.test.OpenSearchTestCase.<clinit>(OpenSearchTestCase.java:251)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:468)
at com.carrotsearch.randomizedtesting.RandomizedRunner$2.run(RandomizedRunner.java:623)
Caused by:
java.lang.NullPointerException: Cannot invoke "String.length()" because "input" is null
...
Whether the system property "tests.coverage.html_report" is set or not, the html format code coverage report is always generated.
Reason:
I used the same System property "tests.coverage" from an old code into my gradle script.
html format code coverage report is generated by default by JaCoCo gralde plugin, see here
To Reproduce
Steps to reproduce the behavior:
For bug 1: run ./gradlew check -Dtests.coverage=true
For bug 2: run ./gradlew codeCoverageReportForUnitTest or ./gradlew codeCoverageReport, without having -Dtests.coverage.html_report, the code coverage report in html format is generated in /build/reports/jacoco/
Expected behavior
./gradlew check -Dtests.coverage=true can run gradle check and generate code coverage report without error.
Without having tests.coverage.html_report property, html format shouldn't be generated, and only xml format is generated. Only when adding the system property tests.coverage.html_report, such as running ./gradlew codeCoverageReport -Dtests.coverage.html_report, the report in html format can be generated.
Plugins
Please list all plugins currently enabled.
Screenshots
If applicable, add screenshots to help explain your problem.
Host/Environment (please complete the following information):
OS: [e.g. iOS]
Version [e.g. 22]
Additional context
Imported by #971
Related issue: #850
The text was updated successfully, but these errors were encountered:
tlfeng
changed the title
[BUG] Code coverage report can't be generated properly due to defect in code-coverage.gradle
[BUG] Code coverage report can't be generated properly due to defects in system property definition
Sep 3, 2021
tlfeng
changed the title
[BUG] Code coverage report can't be generated properly due to defects in system property definition
[BUG] Code coverage report can't be generated properly due to defect in code-coverage.gradle
Sep 3, 2021
Describe the bug
There are 2 bugs in
code-coverage.gradle
:./gradlew check -Dtests.coverage=true
, the following error occurs:Reason:
To Reproduce
Steps to reproduce the behavior:
For bug 1: run
./gradlew check -Dtests.coverage=true
For bug 2: run
./gradlew codeCoverageReportForUnitTest
or./gradlew codeCoverageReport
, without having-Dtests.coverage.html_report
, the code coverage report in html format is generated in/build/reports/jacoco/
Expected behavior
./gradlew check -Dtests.coverage=true
can run gradle check and generate code coverage report without error.tests.coverage.html_report
property, html format shouldn't be generated, and only xml format is generated. Only when adding the system propertytests.coverage.html_report
, such as running./gradlew codeCoverageReport -Dtests.coverage.html_report
, the report in html format can be generated.Plugins
Please list all plugins currently enabled.
Screenshots
If applicable, add screenshots to help explain your problem.
Host/Environment (please complete the following information):
Additional context
Imported by #971
Related issue: #850
The text was updated successfully, but these errors were encountered: