Disable mrm on the CI

This commit is contained in:
Peter Palaga
2020-10-16 23:21:04 +02:00
parent 94e1e2e05d
commit 0569045ac8
4 changed files with 48 additions and 26 deletions

View File

@@ -38,7 +38,7 @@ jobs:
run: gu install native-image
- name: mvn clean verify
run: ./mvnw clean verify -Pnative -B -ntp -e
run: ./mvnw clean verify -Pnative -Dmrm=false -B -ntp -e
- name: Upload daemon test logs
if: ${{ success() || failure() }}
@@ -96,7 +96,7 @@ jobs:
shell: cmd
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
./mvnw clean verify -Pnative -B -ntp -e
./mvnw clean verify -Pnative -Dmrm=false -B -ntp -e
- name: Upload daemon test logs
if: ${{ success() || failure() }}
@@ -126,7 +126,7 @@ jobs:
run: gu install native-image
- name: mvn clean verify
run: ./mvnw clean verify -Pnative -B -ntp -e
run: ./mvnw clean verify -Pnative -Dmrm=false -B -ntp -e
- name: Upload daemon test logs
if: ${{ success() || failure() }}

View File

@@ -91,26 +91,6 @@
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>mrm-maven-plugin</artifactId>
<executions>
<execution>
<id>mrm-start</id>
<phase>process-test-classes</phase>
<goals>
<goal>start</goal>
</goals>
</execution>
<execution>
<id>mrm-stop</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
@@ -148,6 +128,40 @@
</build>
<profiles>
<profile>
<!-- To disable mrm-maven-plugin, pass '-Dmrm=false' to the command line -->
<id>mrm</id>
<activation>
<property>
<name>mrm</name>
<value>!false</value>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>mrm-maven-plugin</artifactId>
<executions>
<execution>
<id>mrm-start</id>
<phase>process-test-classes</phase>
<goals>
<goal>start</goal>
</goals>
</execution>
<execution>
<id>mrm-stop</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>native</id>
<build>

View File

@@ -24,6 +24,7 @@ import java.nio.file.Paths;
import java.util.Locale;
import java.util.Objects;
import java.util.stream.Stream;
import org.apache.log4j.Logger;
import org.jboss.fuse.mvnd.client.Client;
import org.jboss.fuse.mvnd.client.ClientLayout;
import org.jboss.fuse.mvnd.client.DefaultClient;
@@ -41,6 +42,8 @@ import static org.jboss.fuse.mvnd.junit.TestUtils.deleteDir;
public class MvndTestExtension implements BeforeAllCallback, BeforeEachCallback, AfterAllCallback {
private static final Logger LOG = Logger.getLogger(MvndTestExtension.class);
/** A placeholder to replace with a temporary directory outside of the current source tree */
public static final String TEMP_EXTERNAL = "${temp.external}";
private volatile Exception bootException;
@@ -207,11 +210,16 @@ public class MvndTestExtension implements BeforeAllCallback, BeforeEachCallback,
}
static Path createSettings(Path settingsPath) {
final String mrmRepoUrl = System.getProperty("mrm.repository.url");
if (mrmRepoUrl == null || mrmRepoUrl.isEmpty()) {
LOG.info("Building without mrm-maven-plugin");
return null;
}
LOG.info("Building with mrm-maven-plugin");
final Path settingsTemplatePath = Paths.get("src/test/resources/settings-template.xml");
try {
final String template = Files.readString(settingsTemplatePath);
final String content = template.replaceAll("@mrm.repository.url@",
Objects.requireNonNull(System.getProperty("mrm.repository.url")));
final String content = template.replaceAll("@mrm.repository.url@", mrmRepoUrl);
try {
Files.write(settingsPath, content.getBytes(StandardCharsets.UTF_8));
} catch (Exception e) {

View File

@@ -33,7 +33,7 @@
<maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
<maven-install-plugin.version>2.4</maven-install-plugin.version>
<maven-resources-plugin.version>2.6</maven-resources-plugin.version>
<maven-surefire-plugin.version>3.0.0-M5</maven-surefire-plugin.version>
<maven-surefire-plugin.version>2.22.3</maven-surefire-plugin.version>
</properties>
<modules>