Skip to content

Commit f0cf3ac

Browse files
committed
Add it test for skip configured
1 parent d54aa05 commit f0cf3ac

File tree

5 files changed

+75
-0
lines changed

5 files changed

+75
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
invoker.goals=clean verify site -e -ntp

src/it/test_skip_configured/pom.xml

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<parent>
8+
<groupId>it.scoverage-maven-plugin</groupId>
9+
<artifactId>integration_tests_parent</artifactId>
10+
<version>1.0-SNAPSHOT</version>
11+
<relativePath>../integration_tests_parent/pom.xml</relativePath>
12+
</parent>
13+
14+
<artifactId>test_skip_configured</artifactId>
15+
<version>1.0-SNAPSHOT</version>
16+
<packaging>jar</packaging>
17+
<name>Test Scoverage is Skipped when configured</name>
18+
<description>Test Scoverage is Skipped when configured</description>
19+
20+
<build>
21+
<plugins>
22+
<plugin>
23+
<groupId>org.apache.maven.plugins</groupId>
24+
<artifactId>maven-compiler-plugin</artifactId>
25+
</plugin>
26+
<plugin>
27+
<groupId>net.alchim31.maven</groupId>
28+
<artifactId>scala-maven-plugin</artifactId>
29+
</plugin>
30+
<plugin>
31+
<groupId>org.scalatest</groupId>
32+
<artifactId>scalatest-maven-plugin</artifactId>
33+
</plugin>
34+
<plugin>
35+
<groupId>@project.groupId@</groupId>
36+
<artifactId>@project.artifactId@</artifactId>
37+
<configuration>
38+
<skip>true</skip>
39+
</configuration>
40+
</plugin>
41+
</plugins>
42+
</build>
43+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package service
2+
3+
object HelloServiceScala {
4+
def hello = { "Hello" }
5+
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package service
2+
3+
import org.scalatest.wordspec.AnyWordSpec
4+
5+
class HelloServiceScalaTest extends AnyWordSpec {
6+
7+
"HelloService" should {
8+
"say hello" in {
9+
assert(HelloServiceScala.hello == "Hello")
10+
}
11+
}
12+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
try {
2+
3+
def logFile = new File(basedir, "build.log")
4+
def lines = logFile.readLines()
5+
assert lines.contains("[INFO] Skipping Scoverage execution")
6+
assert !lines.contains("Generating \"SCoverage\" report")
7+
8+
return true
9+
10+
} catch (Throwable e) {
11+
e.printStackTrace()
12+
return false
13+
}

0 commit comments

Comments
 (0)