Skip to content

Commit

Permalink
Do not run NativeImageBuildContainerRunnerTest test unless -Dtest-con…
Browse files Browse the repository at this point in the history
…tainers is set.
  • Loading branch information
holly-cummins committed Apr 27, 2022
1 parent 43afda6 commit 7a466f5
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
33 changes: 33 additions & 0 deletions core/deployment/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,15 @@

<build>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<systemPropertyVariables>
<!-- Give tests a hint to not use containers, by default -->
<avoid-containers>true</avoid-containers>
</systemPropertyVariables>
</configuration>
</plugin>
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
<executions>
Expand Down Expand Up @@ -179,4 +188,28 @@
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>test-native-container-build</id>
<activation>
<property>
<name>start-containers</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<systemPropertyVariables>
<!-- Enable the container-based tests -->
<avoid-containers>false</avoid-containers>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@
import java.util.Optional;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledIfSystemProperty;

import io.quarkus.deployment.pkg.NativeConfig;

class NativeImageBuildContainerRunnerTest {

// This will default to false in the maven build and true in the IDE, so this will still run if invoked explicitly
@DisabledIfSystemProperty(named = "avoid-containers", matches = "true")
@Test
void testBuilderImageBeingPickedUp() {
NativeConfig nativeConfig = new NativeConfig();
Expand Down

0 comments on commit 7a466f5

Please sign in to comment.