Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: don't download webapps when only running tests #18801

Merged
merged 5 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/run-api-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ jobs:
if [ "$DOCKERHUB_PUSH" = "true" ]; then
# build and publish multi-arch images using Jib. Image is used for api tests in
# this workflow and can be pulled from Dockerhub by devs to run locally, ...
mvn clean package --threads 2C --batch-mode --no-transfer-progress \
-DskipTests -Dmaven.test.skip=true --update-snapshots --file dhis-2/pom.xml \
mvn clean verify --threads 2C --batch-mode --no-transfer-progress \
-DskipTests --update-snapshots --file dhis-2/pom.xml \
--projects dhis-web-server --also-make --activate-profiles jibBuild \
-Djib.to.image=$CORE_IMAGE_NAME -Djib.container.labels=DHIS2_BUILD_REVISION=${{github.event.pull_request.head.sha}},DHIS2_BUILD_BRANCH=${{github.head_ref}}
else
# only build image for running api tests in this workflow i.e. master, 2.39, ...
mvn clean package --threads 2C --batch-mode --no-transfer-progress \
-DskipTests -Dmaven.test.skip=true --update-snapshots --file dhis-2/pom.xml \
mvn clean verify --threads 2C --batch-mode --no-transfer-progress \
-DskipTests --update-snapshots --file dhis-2/pom.xml \
--projects dhis-web-server --also-make --activate-profiles jibDockerBuild \
-Djib.to.image=$CORE_IMAGE_NAME
fi
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
distribution: temurin
cache: maven
- name: Run unit tests
run: mvn clean verify --threads 2C --batch-mode --no-transfer-progress --update-snapshots --file ./dhis-2/pom.xml --activate-profiles unit-test
run: mvn clean test --threads 2C --batch-mode --no-transfer-progress --update-snapshots --file ./dhis-2/pom.xml --activate-profiles unit-test
timeout-minutes: 30
- name: Report coverage to codecov
uses: codecov/codecov-action@v3
Expand Down Expand Up @@ -65,7 +65,7 @@ jobs:
distribution: temurin
cache: maven
- name: Run integration tests
run: mvn clean verify --threads 2C --batch-mode --no-transfer-progress --update-snapshots --file ./dhis-2/pom.xml --activate-profiles integration-test
run: mvn clean test --threads 2C --batch-mode --no-transfer-progress --update-snapshots --file ./dhis-2/pom.xml --activate-profiles integration-test
timeout-minutes: 30
- uses: actions/upload-artifact@v4
name: Upload test logs on failure
Expand Down Expand Up @@ -116,7 +116,7 @@ jobs:
distribution: temurin
cache: maven
- name: Run integration h2 tests
run: mvn clean verify --threads 2C --batch-mode --no-transfer-progress --update-snapshots --file ./dhis-2/pom.xml --activate-profiles integration-h2-test
run: mvn clean test --threads 2C --batch-mode --no-transfer-progress --update-snapshots --file ./dhis-2/pom.xml --activate-profiles integration-h2-test
timeout-minutes: 30
- uses: actions/upload-artifact@v4
name: Upload test logs on failure
Expand Down
2 changes: 1 addition & 1 deletion dhis-2/dhis-test-coverage/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@
<goals>
<goal>report-aggregate</goal>
</goals>
<phase>verify</phase>
<phase>test</phase>
</execution>
</executions>
</plugin>
Expand Down
2 changes: 1 addition & 1 deletion dhis-2/dhis-web-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@
<goals>
<goal>exec</goal>
</goals>
<phase>generate-resources</phase>
<phase>prepare-package</phase>
</execution>
</executions>
</plugin>
Expand Down
10 changes: 8 additions & 2 deletions dhis-2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2155,6 +2155,14 @@ jasperreports.version=${jasperreports.version}
<goal>prepare-agent</goal>
</goals>
</execution>
<!-- bind it to test instead of default verify so we get coverage reports when only running mvn test -->
<execution>
<id>report</id>
<goals>
<goal>report</goal>
</goals>
<phase>test</phase>
</execution>
</executions>
</plugin>
</plugins>
Expand Down Expand Up @@ -2354,10 +2362,8 @@ jasperreports.version=${jasperreports.version}
<goals>
<goal>analyze-only</goal>
</goals>
<phase>process-test-classes</phase>
<configuration>
<failOnWarning>true</failOnWarning>
<skip>${skipTests}</skip>
</configuration>
</execution>
</executions>
Expand Down
Loading