use failsafe plugin for integration tests instead of "offline" profile

This commit is contained in:
Stefan Kalscheuer 2021-11-21 11:19:08 +01:00
parent 4045b1a4fd
commit b4a822bf10
4 changed files with 26 additions and 21 deletions

View File

@ -16,7 +16,7 @@ steps:
- name: unit-tests
image: maven:3-jdk-11
commands:
- mvn -B resources:testResources compiler:testCompile surefire:test -P offline-tests
- mvn -B test
when:
branch:
- develop
@ -32,8 +32,8 @@ steps:
- unzip vault_1.9.0_linux_amd64.zip
- rm vault_1.9.0_linux_amd64.zip
- mv vault /bin/
- mvn -B resources:testResources compiler:testCompile surefire:test
- mvn -B -P integration-test verify
when:
branch:
- main
- release/*
- release/*

View File

@ -21,6 +21,8 @@ jobs:
with:
java-version: ${{ matrix.jdk }}
distribution: 'temurin'
- name: Compile
run: mvn -B clean compile
- name: Set up Vault
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/')
run: |
@ -29,14 +31,14 @@ jobs:
unzip "vault_${{ matrix.vault }}_linux_amd64.zip"
rm "vault_${{ matrix.vault }}_linux_amd64.zip"
sudo mv vault /usr/bin/vault
- name: Test
- name: Test (Unit & Integration)
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/')
env:
VAULT_VERSION: ${{ matrix.vault }}
run: mvn -B -P coverage clean verify
- name: Test (offline)
run: mvn -B -P coverage -P integration-test verify
- name: Test (Unit)
if: github.ref != 'refs/heads/main' && !startsWith(github.ref, 'refs/heads/release/')
run: mvn -B -P offline-tests -P coverage clean verify
run: mvn -B -P coverage verify
- name: Analysis
if: matrix.analysis && github.event_name == 'push'
run: >

28
pom.xml
View File

@ -266,19 +266,23 @@
</profile>
<profile>
<id>offline-tests</id>
<id>integration-test</id>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludedGroups>online</excludedGroups>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.22.2</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>

View File

@ -48,8 +48,7 @@ import static org.junit.jupiter.api.Assumptions.assumeTrue;
* @author Stefan Kalscheuer
* @since 0.1
*/
@Tag("online")
class HTTPVaultConnectorTest {
class HTTPVaultConnectorIT {
private static String VAULT_VERSION = "1.9.0"; // The vault version this test is supposed to run against.
private static final String KEY1 = "E38bkCm0VhUvpdCKGQpcohhD9XmcHJ/2hreOSY019Lho";
private static final String KEY2 = "O5OHwDleY3IiPdgw61cgHlhsrEm6tVJkrxhF6QAnILd1";