Skip to content

Commit

Permalink
Clarify skip message and add an it-test for skip
Browse files Browse the repository at this point in the history
  • Loading branch information
jozic committed Nov 13, 2024
1 parent d54aa05 commit 4ff7bac
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/it/test_skip_configured/invoker.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
invoker.goals=clean verify site -e -ntp
43 changes: 43 additions & 0 deletions src/it/test_skip_configured/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>it.scoverage-maven-plugin</groupId>
<artifactId>integration_tests_parent</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath>../integration_tests_parent/pom.xml</relativePath>
</parent>

<artifactId>test_skip_configured</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Test Scoverage is Skipped when configured</name>
<description>Test Scoverage is Skipped when configured</description>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.scalatest</groupId>
<artifactId>scalatest-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>@project.groupId@</groupId>
<artifactId>@project.artifactId@</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package service

object HelloServiceScala {
def hello = { "Hello" }

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package service

import org.scalatest.wordspec.AnyWordSpec

class HelloServiceScalaTest extends AnyWordSpec {

"HelloService" should {
"say hello" in {
assert(HelloServiceScala.hello == "Hello")
}
}
}
13 changes: 13 additions & 0 deletions src/it/test_skip_configured/validate.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
try {

def logFile = new File(basedir, "build.log")
def lines = logFile.readLines()
assert lines.contains("[INFO] Skipping Scoverage execution as configured")
assert !lines.contains("Generating \"SCoverage\" report")

return true

} catch (Throwable e) {
e.printStackTrace()
return false
}
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ public void execute() throws MojoExecutionException

if ( skip )
{
getLog().info( "Skipping Scoverage execution" );
getLog().info( "Skipping Scoverage execution as configured" );

Properties projectProperties = project.getProperties();

Expand Down

0 comments on commit 4ff7bac

Please sign in to comment.