Skip to content

Commit

Permalink
406001 integration test dmz (#59)
Browse files Browse the repository at this point in the history
* Add test on self-hosted to the CI pipeline

* split the report path

* add aggregate test reports

* Reset pom.xml

* add surefire report plugin

* Revert "add surefire report plugin"

This reverts commit e9e0718.

* Revert "Reset pom.xml"

This reverts commit 548504c.

* Revert "add aggregate test reports"

This reverts commit 8fc7668.

* Add reports for both env settings

* Add different names for the testing steps

* Include test group for selfhosted

* Move unit tests into a separate step

* Refactor common env variables

* Removed anchors

* configured test path

* Modified mvn test command

* Minor refactors
  • Loading branch information
matt-yin-lf authored May 12, 2023
1 parent ccaac3d commit 63b625f
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 7 deletions.
48 changes: 42 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ jobs:

runs-on: ubuntu-latest

env:
ACCESS_KEY: ${{ secrets.DEV_CA_PUBLIC_USE_INTEGRATION_TEST_ACCESS_KEY }}
SERVICE_PRINCIPAL_KEY: ${{ secrets.DEV_CA_PUBLIC_USE_TESTOAUTHSERVICEPRINCIPAL_SERVICE_PRINCIPAL_KEY }}

steps:
- uses: actions/checkout@v3

Expand All @@ -29,17 +33,49 @@ jobs:
- name: Build with Maven
run: mvn -B package -Dmaven.test.skip=true --file pom.xml

- name: Run tests
- name: Run unit tests
run: mvn -Dtest=com.laserfiche.api.client.unit.*Test test

- name: Publish unit test results
uses: EnricoMi/publish-unit-test-result-action@v1
if: always()
with:
files: target/surefire-reports/*.xml
check_name: unit-test-results

- name: Delete test reports
run: rm -rf target/surefire-reports/*.xml

- name: Run integration tests on cloud
id: integration-test-cloud
run: mvn test -Dgroups=Cloud

- name: Publish cloud test results
uses: EnricoMi/publish-unit-test-result-action@v1
if: always()
with:
files: target/surefire-reports/*.xml
check_name: integration-test-results-cloud

- name: Delete test reports
run: rm -rf target/surefire-reports/*.xml

- name: Run integration tests on self-hosted
id: integration-test-self-hosted
if: always() && (steps.integration-test-cloud.outcome == 'success' || steps.integration-test-cloud.outcome == 'failure')
env:
ACCESS_KEY: ${{ secrets.DEV_CA_PUBLIC_USE_INTEGRATION_TEST_ACCESS_KEY }}
SERVICE_PRINCIPAL_KEY: ${{ secrets.DEV_CA_PUBLIC_USE_TESTOAUTHSERVICEPRINCIPAL_SERVICE_PRINCIPAL_KEY }}
run: mvn test
REPOSITORY_ID: ${{ secrets.APISERVER_REPOSITORY_ID }}
APISERVER_USERNAME: ${{ secrets.APISERVER_USERNAME }}
APISERVER_PASSWORD: ${{ secrets.APISERVER_PASSWORD }}
APISERVER_REPOSITORY_API_BASE_URL: ${{ secrets.APISERVER_REPOSITORY_API_BASE_URL }}
run: mvn test -Dgroups=SelfHosted

- name: Publish Test Results
- name: Publish self-hosted test results
uses: EnricoMi/publish-unit-test-result-action@v1
if: always()
with:
files: "target/surefire-reports/*.xml"
files: target/surefire-reports/*.xml
check_name: integration-test-results-self-hosted

build-documentation:

Expand Down
1 change: 0 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@
<argLine>-Xms512m -Xmx1500m</argLine>
<parallel>methods</parallel>
<forkMode>pertest</forkMode>
<excludedGroups>SelfHosted</excludedGroups>
</configuration>
</plugin>
<plugin>
Expand Down

0 comments on commit 63b625f

Please sign in to comment.