Skip to content

Commit

Permalink
Fixes running test, if CoS is enabled. Fixes Apply Changes in Debugger.
Browse files Browse the repository at this point in the history
  • Loading branch information
svatoun committed May 3, 2020
1 parent df599ed commit 54d947d
Show file tree
Hide file tree
Showing 2 changed files with 125 additions and 9 deletions.
8 changes: 5 additions & 3 deletions nbactions.xml
Expand Up @@ -75,10 +75,10 @@
</packagings>
<goals>
<goal>test</goal>
<goal>jacoco:report</goal>
</goals>
<properties>
<test>${packageClassName}</test>
<netbeans.jacoco.report>true</netbeans.jacoco.report>
</properties>
</action>
<action>
Expand All @@ -88,7 +88,9 @@
</packagings>
<goals>
<goal>test</goal>
<goal>jacoco:report</goal>
</goals>
<properties>
<netbeans.jacoco.report>true</netbeans.jacoco.report>
</properties>
</action>
</actions>
</actions>
126 changes: 120 additions & 6 deletions pom.xml
Expand Up @@ -281,6 +281,104 @@
</plugins>
</build>
</profile>
<profile>
<!--
The profile disables if tests are run in debug mode, so Jacoco instrumentation
does not break debugging features.
-->
<id>jacoco-coverage-unit</id>
<activation>
<property>
<name>!maven.surefire.debug</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<!--
The profile disables if tests are run in debug mode, so Jacoco instrumentation
does not break debugging features.
-->
<id>jacoco-coverage-integration</id>
<activation>
<property>
<name>!maven.surefire.debug</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
<executions>
<execution>
<id>prepare-agent-integration</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<!--
This profile is a workaround for NetBeans broken (?) support for multiple
maven goals on action where Compile-on-Save is enabled. Instead of running a
goal sequence, the IDE sets a property that activates this profile.
-->
<id>jacoco-coverage-ide-report</id>
<activation>
<activeByDefault>false</activeByDefault>
<property>
<name>netbeans.jacoco.report</name>
<value>true</value>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
<executions>
<execution>
<id>ide-report</id>
<goals>
<goal>report</goal>
</goals>
<!-- Bind to the test phase. The Jacoco plugin is
configured AFTER surefire plugin in this POM, so starting with Maven 3.0.3
the Jacoco plugin goals will only run after surefire testing completes
-->
<phase>test</phase>
<configuration>
<skip>${skipTests}</skip>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<build>
Expand Down Expand Up @@ -662,15 +760,15 @@
</configuration>
</plugin>
<plugin>
<!-- Warning: do not put this plugin's configuration before surefire plugin one. The sequence
in which the surefire and jacoco goals run is important -->
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
<!-- Do not bind any goals, let a profile to do it conditionally -->
<configuration>
<append>true</append>
<destFile>${jacoco.reportDir}/jacoco-unit.exec</destFile>
Expand All @@ -679,9 +777,7 @@
</execution>
<execution>
<id>prepare-agent-integration</id>
<goals>
<goal>prepare-agent</goal>
</goals>
<!-- Do not bind any goals, let a profile to do it conditionally -->
<configuration>
<append>true</append>
<destFile>${jacoco.reportDir}/jacoco-it.exec</destFile>
Expand All @@ -707,6 +803,24 @@
</execution>
<execution>
<id>default-cli</id>
<configuration>
<fileSets>
<fileSet>
<directory>${jacoco.reportDir}</directory>
<includes>
<File>**/*.exec</File>
</includes>
</fileSet>
</fileSets>
</configuration>
</execution>
<execution>
<!-- Do a merge after unit tests complete, to cover the case that only goals up to 'test' phase
are executed. The post-integration-test will merge in integration tests' coverage -->
<id>post-test-merge</id>
<!-- Must explicitly bind to the phase. Since this plugin is configured AFTER surefire,
it will bind later that surefire:test into the (same) test phase -->
<phase>test</phase>
<goals>
<goal>merge</goal>
</goals>
Expand Down

0 comments on commit 54d947d

Please sign in to comment.