forked from apache/geode
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GEODE-10075 Fix jacoco code coverage reports
We haven't been maintaining this gradle build support, but it is useful to be able to get code coverage from distributed test runs, eg. ./gradlew geode-core:distributedTest -PcodeCoverage --tests XXX geode-core:jacocoDistributedTestReport Changes: * Upgraded the jacoco report tasks to use the newer syntax for locations * Changed our WorkingDirectoryIsolator to fix the relative paths to the jacoco agent and execution trace files. It's hard for me to tell if gradle is actually using windows or unix paths when running on Windows. Just to be sure, adding support for both types of paths for this change and adding a unit test of WorkingDirectoryIsolator.
- Loading branch information
1 parent
c997cea
commit 7904e87
Showing
3 changed files
with
82 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
...src/test/java/org/apache/geode/gradle/testing/isolation/WorkingDirectoryIsolatorTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license | ||
* agreements. See the NOTICE file distributed with this work for additional information regarding | ||
* copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance with the License. You may obtain a | ||
* copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License | ||
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express | ||
* or implied. See the License for the specific language governing permissions and limitations under | ||
* the License. | ||
* | ||
*/ | ||
package org.apache.geode.gradle.testing.isolation; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
|
||
import java.io.File; | ||
import java.util.Arrays; | ||
|
||
import org.junit.Test; | ||
|
||
public class WorkingDirectoryIsolatorTest { | ||
|
||
@Test | ||
public void updatesRelativeUnixPaths() { | ||
ProcessBuilder processBuilder = new ProcessBuilder(); | ||
processBuilder.directory(new File("")); | ||
processBuilder.command("/bin/java", "-javaagent:../some/jacocoagent.jar=destfile=../jacoco/integrationTest.exec", "GradleWorkerMain"); | ||
new WorkingDirectoryIsolator().accept(processBuilder); | ||
|
||
assertEquals(Arrays.asList("/bin/java", "-javaagent:../../some/jacocoagent.jar=destfile=../../jacoco/integrationTest.exec", "GradleWorkerMain"), processBuilder.command()); | ||
} | ||
|
||
@Test | ||
public void updatesRelativeWindowsPaths() { | ||
ProcessBuilder processBuilder = new ProcessBuilder(); | ||
processBuilder.directory(new File("")); | ||
processBuilder.command("/bin/java", "-javaagent:..\\some\\jacocoagent.jar=destfile=..\\jacoco\\integrationTest.exec", "GradleWorkerMain"); | ||
new WorkingDirectoryIsolator().accept(processBuilder); | ||
|
||
assertEquals(Arrays.asList("/bin/java", "-javaagent:..\\..\\some\\jacocoagent.jar=destfile=..\\..\\jacoco\\integrationTest.exec", "GradleWorkerMain"), processBuilder.command()); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters