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

collect jacoco result #11532

Merged
merged 10 commits into from
Feb 14, 2023
Merged
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
74 changes: 72 additions & 2 deletions .github/workflows/build-and-test-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ env:
SHOW_ERROR_DETAIL: 1
#multi-version size limit
VERSIONS_LIMIT: 4
JACOCO_ENABLE: true
CANDIDATE_VERSIONS: '
spring.version:4.3.30.RELEASE;
spring-boot.version:1.5.22.RELEASE;
Expand Down Expand Up @@ -71,6 +72,22 @@ jobs:
run: |
cd ./dubbo
./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean source:jar install -Pjacoco,checkstyle -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=5 -Dmaven.test.skip=true -Dmaven.test.skip.exec=true -DembeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper
- name: "Pack class result"
run: 7z a ${{ github.workspace }}/class.zip */target/classes/* -r
- name: "Upload class result"
uses: actions/upload-artifact@v3
with:
name: "class-file"
path: ${{ github.workspace }}/class.zip
- name: "Pack rat file if failure"
if: failure()
run: 7z a ${{ github.workspace }}/rat.zip *rat.txt -r
- name: "Upload rat file if failure"
if: failure()
uses: actions/upload-artifact@v3
with:
name: "rat-file"
path: ${{ github.workspace }}/rat.zip
- name: "Pack checkstyle file if failure"
if: failure()
run: 7z a ${{ github.workspace }}/checkstyle.zip *checkstyle* -r
Expand Down Expand Up @@ -196,8 +213,11 @@ jobs:
timeout-minutes: 70
run: |
./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean test verify -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Pjacoco,jdk15ge-simple,'!jdk15ge',jacoco089 -DtrimStackTrace=false -Dmaven.wagon.http.retryHandler.count=5 -DskipTests=false -DskipIntegrationTests=false -Dcheckstyle.skip=false -Dcheckstyle_unix.skip=false -Drat.skip=false -Dmaven.javadoc.skip=true -DembeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper
- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v3
- name: "Upload coverage result"
uses: actions/upload-artifact@v3
with:
name: coverage-result
path: "**/target/site/**/jacoco.xml"

integration-test-prepare:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -270,6 +290,14 @@ jobs:
cd test && bash ./build-test-image.sh
- name: "Run tests"
run: cd test && bash ./run-tests.sh
- name: "merge jacoco resule"
run: |
cd test/dubbo-test-jacoco-merger && mvn clean compile exec:java -Dexec.mainClass="org.apache.dubbo.test.JacocoMerge" -Dexec.args="${{github.workspace}}"
- name: "Upload jacoco"
uses: actions/upload-artifact@v3
with:
name: jacoco-result
path: target/jacoco*.exec
- name: "Upload test result"
if: always()
uses: actions/upload-artifact@v3
Expand All @@ -296,6 +324,48 @@ jobs:
- name: "Merge test result"
run: ./test/scripts/merge-test-results.sh

jacoco-result-merge:
runs-on: ubuntu-latest
needs: [integration-test-result, unit-test]
steps:
- uses: actions/checkout@v3
with:
path: "./dubbo"
- uses: actions/checkout@v3
with:
repository: 'apache/dubbo-samples'
path: "./dubbo-samples"
- name: "Set up JDK 17"
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 17
- name: "Restore class result"
uses: actions/download-artifact@v3
with:
name: "class-file"
path: ${{ github.workspace }}
- name: "Unpack class result"
run: |
cd ${{ github.workspace }}/dubbo
unzip -o ${{ github.workspace }}/class.zip
- name: "Restore jacoco exec"
uses: actions/download-artifact@v3
with:
name: jacoco-result
path: dubbo-samples/target/
- name: "Merge jacoco result"
run: |
cd ${{ github.workspace }}/dubbo-samples/test/dubbo-test-jacoco-merger
mvn clean compile exec:java -Dexec.mainClass="org.apache.dubbo.test.JacocoReport" -Dexec.args="${{github.workspace}}/dubbo-samples ${{github.workspace}}/dubbo"
- name: "Restore coverage result"
uses: actions/download-artifact@v3
with:
name: coverage-result
path: dubbo/
- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v3

error-code-inspecting:
runs-on: ubuntu-latest
steps:
Expand Down