Skip to content

Commit

Permalink
test: force surefire version
Browse files Browse the repository at this point in the history
to fix windows image test issues
  • Loading branch information
carlossg committed Feb 13, 2023
1 parent 42e4799 commit 5d4f7f8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
9 changes: 9 additions & 0 deletions tests/maven.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,15 @@ Describe "$SUT_TAG run Maven" {
}
}

Describe "$SUT_TAG run Surefire" {
It 'runs maven' {
# -Dplugin='org.apache.maven.plugins:maven-surefire-plugin' works in windowsservercore but not in nanoserver
$exitCode, $stdout, $stderr = Run-Program -Cmd "docker.exe" -Params "run --rm ${SUT_TEST_IMAGE}:${SUT_TAG} mvn -B -ntp -f C:/Temp -Dplugin=surefire help:describe"
$exitCode | Should -Be 0
$stdout | Should -Match "Version: 2.12.4"
}
}

Describe "$SUT_TAG generate sample project" {
It 'generates sample project' {
$exitCode, $stdout, $stderr = Run-Program -Cmd "docker.exe" -Params "run --rm ${SUT_TEST_IMAGE}:${SUT_TAG} mvn -B archetype:generate -DgroupId=pester-testing -DartifactId=pester-test-project -DarchetypeArtifactId=maven-archetype-quickstart"
Expand Down
14 changes: 12 additions & 2 deletions tests/pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<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
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>
<groupId>com.example</groupId>
Expand All @@ -19,4 +18,15 @@
<version>4.13.1</version>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12.4</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>

0 comments on commit 5d4f7f8

Please sign in to comment.