Skip to content

Commit

Permalink
[SUREFIRE-2225] Surefire ITs fail when project directory contains space
Browse files Browse the repository at this point in the history
This closes #705
  • Loading branch information
michael-o committed Dec 30, 2023
1 parent 83c4666 commit 4eb0fd5
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
Expand Up @@ -80,6 +80,10 @@ private List<String> getInitialGoals() {
goals.add("-Dsurefire.version=" + surefireVersion);

String jacocoAgent = System.getProperty("jacoco.agent", "");
// Remove unnecessary backslash escaping for Windows, see https://github.com/jacoco/jacoco/issues/1559
jacocoAgent = jacocoAgent.replace("\\\\", "\\");
// Remove quotes which will cause a syntax error raised by cmd.exe because of quote escaping
jacocoAgent = jacocoAgent.replace("\"", "");
goals.add("-Djacoco.agent=" + jacocoAgent);
goals.add("-nsu");

Expand Down
2 changes: 1 addition & 1 deletion surefire-its/src/test/resources/junit47-parallel/pom.xml
Expand Up @@ -62,7 +62,7 @@
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>${argLine} ${jacoco.agent}</argLine>
<argLine>${argLine} "${jacoco.agent}"</argLine>
</configuration>
</plugin>
</plugins>
Expand Down
Expand Up @@ -43,7 +43,7 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>${surefire.version}</version>
<configuration>
<argLine>${argLine} ${jacoco.agent}</argLine>
<argLine>${argLine} "${jacoco.agent}"</argLine>
<parallel>methods</parallel>
<properties>
<property>
Expand Down
Expand Up @@ -43,7 +43,7 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>${surefire.version}</version>
<configuration>
<argLine>${argLine} ${jacoco.agent}</argLine>
<argLine>${argLine} "${jacoco.agent}"</argLine>
<parallel>methods</parallel>
<threadCount>10</threadCount>
<properties>
Expand Down
2 changes: 1 addition & 1 deletion surefire-its/src/test/resources/testng-simple/pom.xml
Expand Up @@ -87,7 +87,7 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>${surefire.version}</version>
<configuration>
<argLine>${argLine} ${jacoco.agent}</argLine>
<argLine>${argLine} "${jacoco.agent}"</argLine>
<runOrder>reversealphabetical</runOrder>
<properties>
<property>
Expand Down

0 comments on commit 4eb0fd5

Please sign in to comment.