Skip to content

Commit

Permalink
Failsafe wiring of real tests if secrets configured
Browse files Browse the repository at this point in the history
  • Loading branch information
duttonw committed Jul 25, 2024
1 parent 9eb62a4 commit d2ee025
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 6 deletions.
17 changes: 13 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,16 @@ jobs:
KITEWORKS_ACCESS_TOKEN_URI: ${{ secrets.KITEWORKS_ACCESS_TOKEN_URI }}
run: mvn clean install -Dspring.profiles.active=cicd

# - name: Publish to GitHub Packages Apache Maven
# run: mvn deploy
# env:
# GITHUB_TOKEN: ${{ github.token }} # GITHUB_TOKEN is the default env for the password
- name: Package artifacts
run: |
mkdir staging
cp */target/*.jar staging
cp -rf */target/*reports staging
cp -r */target/generated-sources/openapi/api staging
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: Package
path: staging
overwrite: true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
target/
/staging
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
Expand Down
35 changes: 35 additions & 0 deletions kiteworks-spring-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,41 @@
<groupId>org.apache.maven.plugins </groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.3.1</version>
<executions>
<execution>
<id>IntegrationTest</id>
<goals>
<goal>verify</goal>
<goal>integration-test</goal>
</goals>
<configuration>
<includes>
<include>**/*IntegrationTest.java</include>
</includes>
<skipTests>${skipTests}</skipTests>
</configuration>
</execution>
<execution>
<id>IT</id>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
<configuration>
<includes>
<include>**/*IT.java</include>
</includes>
<systemPropertyVariables>
<!--
Set a system property for the test clients to use when connecting.
Something like Apache's commons-configuration can pick this up
transparently.
-->
</systemPropertyVariables>
<skipTests>${skipTests}</skipTests>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
@SpringBootTest( classes = {KiteworksSpringService.class, ProxyConfig.class})
@EnableConfigurationProperties
@ActiveProfiles("cicd")
public class EndToEndTestIT {
public class EndToEndIT {

@Autowired
private KiteworksService kiteworksService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
@Import({KiteworksTestConfig.class})
@EnableConfigurationProperties
@ActiveProfiles("test")
public class IntegrationTest {
public class ServiceWireTest {

@Autowired
private KiteworksService kiteworksService;
Expand Down

0 comments on commit d2ee025

Please sign in to comment.