From ce2b51b707386b58f6f008fc22407fa77336f812 Mon Sep 17 00:00:00 2001 From: Albumen Kevin Date: Sun, 12 Feb 2023 15:54:07 +0800 Subject: [PATCH 1/9] collect jacoco result --- .github/workflows/build-and-test-pr.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/build-and-test-pr.yml b/.github/workflows/build-and-test-pr.yml index 2e9b7aacb64..1b7c376b86a 100644 --- a/.github/workflows/build-and-test-pr.yml +++ b/.github/workflows/build-and-test-pr.yml @@ -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; @@ -279,6 +280,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.JacocoMerger" -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 From 819cb8d91d752f9fe146a09881f985fe36f8d9da Mon Sep 17 00:00:00 2001 From: Albumen Kevin Date: Sun, 12 Feb 2023 22:51:28 +0800 Subject: [PATCH 2/9] collect jacoco result --- .github/workflows/build-and-test-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-test-pr.yml b/.github/workflows/build-and-test-pr.yml index 1b7c376b86a..e75ac81cc25 100644 --- a/.github/workflows/build-and-test-pr.yml +++ b/.github/workflows/build-and-test-pr.yml @@ -282,7 +282,7 @@ jobs: 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.JacocoMerger" -Dexec.args="${{github.workspace}}" + 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: From 1c4bbaea7900977a5b28c990564e28d4e2721246 Mon Sep 17 00:00:00 2001 From: Albumen Kevin Date: Sun, 12 Feb 2023 22:56:00 +0800 Subject: [PATCH 3/9] collect jacoco result --- .github/workflows/build-and-test-pr.yml | 31 +++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/.github/workflows/build-and-test-pr.yml b/.github/workflows/build-and-test-pr.yml index e75ac81cc25..9629c0eb19d 100644 --- a/.github/workflows/build-and-test-pr.yml +++ b/.github/workflows/build-and-test-pr.yml @@ -314,6 +314,37 @@ jobs: - name: "Merge test result" run: ./test/scripts/merge-test-results.sh + jacoco-result-merge: + runs-on: ubuntu-latest + needs: [integration-test-result] + 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: "Compile Dubbo (Linux)" + run: | + cd ${{ github.workspace }}/dubbo + ./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean install -DskipTests=true -DskipIntegrationTests=true -Dcheckstyle.skip=true -Dcheckstyle_unix.skip=true -Drat.skip=true -Dmaven.javadoc.skip=true + - name: "Restore jacoco exec" + uses: actions/upload-artifact@v3 + with: + name: jacoco-result + path: dubbo-samples/target/jacoco*.exec + - name: "merge jacoco resule" + 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: "Upload coverage to Codecov" + uses: codecov/codecov-action@v3 error-code-inspecting: runs-on: ubuntu-latest steps: From aaf39568f84d12455a16bbdbcd84c8bc7c838737 Mon Sep 17 00:00:00 2001 From: Albumen Kevin Date: Mon, 13 Feb 2023 06:19:35 +0800 Subject: [PATCH 4/9] Update cov --- .github/workflows/build-and-test-pr.yml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-and-test-pr.yml b/.github/workflows/build-and-test-pr.yml index 9629c0eb19d..255bc1c3ab0 100644 --- a/.github/workflows/build-and-test-pr.yml +++ b/.github/workflows/build-and-test-pr.yml @@ -206,8 +206,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-aggregate/**" integration-test-prepare: runs-on: ubuntu-latest @@ -335,16 +338,22 @@ jobs: cd ${{ github.workspace }}/dubbo ./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean install -DskipTests=true -DskipIntegrationTests=true -Dcheckstyle.skip=true -Dcheckstyle_unix.skip=true -Drat.skip=true -Dmaven.javadoc.skip=true - name: "Restore jacoco exec" - uses: actions/upload-artifact@v3 + uses: actions/download-artifact@v3 with: name: jacoco-result - path: dubbo-samples/target/jacoco*.exec - - name: "merge jacoco resule" + 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: From 3d74a37196dd9951eff41d997b4102fcef68a52e Mon Sep 17 00:00:00 2001 From: Albumen Kevin Date: Mon, 13 Feb 2023 07:02:59 +0800 Subject: [PATCH 5/9] Update cov --- .github/workflows/build-and-test-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-test-pr.yml b/.github/workflows/build-and-test-pr.yml index 255bc1c3ab0..6bf85d95e6a 100644 --- a/.github/workflows/build-and-test-pr.yml +++ b/.github/workflows/build-and-test-pr.yml @@ -210,7 +210,7 @@ jobs: uses: actions/upload-artifact@v3 with: name: coverage-result - path: "**/target/site/jacoco-aggregate/**" + path: "**/target/site/jacoco-aggregate/jacoco.xml" integration-test-prepare: runs-on: ubuntu-latest From ca91de57a94c8a94cb916bca495034f386d22112 Mon Sep 17 00:00:00 2001 From: Albumen Kevin Date: Mon, 13 Feb 2023 09:05:49 +0800 Subject: [PATCH 6/9] Update cov --- .github/workflows/build-and-test-pr.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-test-pr.yml b/.github/workflows/build-and-test-pr.yml index 6bf85d95e6a..c8665f3338f 100644 --- a/.github/workflows/build-and-test-pr.yml +++ b/.github/workflows/build-and-test-pr.yml @@ -72,6 +72,13 @@ jobs: run: | cd ./dubbo ./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean source:jar install -Pjacoco,rat,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 @@ -333,10 +340,15 @@ jobs: with: distribution: 'zulu' java-version: 17 - - name: "Compile Dubbo (Linux)" + - name: "Restore class result" + uses: actions/download-artifact@v3 + with: + name: "class-file" + path: ${{ github.workspace }}/class.zip + - name: "Unpack class result" run: | cd ${{ github.workspace }}/dubbo - ./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean install -DskipTests=true -DskipIntegrationTests=true -Dcheckstyle.skip=true -Dcheckstyle_unix.skip=true -Drat.skip=true -Dmaven.javadoc.skip=true + unzip -o ${{ github.workspace }}/class.zip - name: "Restore jacoco exec" uses: actions/download-artifact@v3 with: From 6da3db9904b1c0180cb936057dc266ef5ed8b58f Mon Sep 17 00:00:00 2001 From: Albumen Kevin Date: Mon, 13 Feb 2023 09:39:47 +0800 Subject: [PATCH 7/9] Update cov --- .github/workflows/build-and-test-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-test-pr.yml b/.github/workflows/build-and-test-pr.yml index a50521e85c2..eac5b162b84 100644 --- a/.github/workflows/build-and-test-pr.yml +++ b/.github/workflows/build-and-test-pr.yml @@ -326,7 +326,7 @@ jobs: jacoco-result-merge: runs-on: ubuntu-latest - needs: [integration-test-result] + needs: [integration-test-result, unit-test] steps: - uses: actions/checkout@v3 with: From 95d5b6d8e2ca8b9006f7df398dc9ceb7786cf82d Mon Sep 17 00:00:00 2001 From: Albumen Kevin Date: Mon, 13 Feb 2023 09:41:48 +0800 Subject: [PATCH 8/9] Update cov --- .github/workflows/build-and-test-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-test-pr.yml b/.github/workflows/build-and-test-pr.yml index eac5b162b84..e55efed0207 100644 --- a/.github/workflows/build-and-test-pr.yml +++ b/.github/workflows/build-and-test-pr.yml @@ -344,7 +344,7 @@ jobs: uses: actions/download-artifact@v3 with: name: "class-file" - path: ${{ github.workspace }}/class.zip + path: ${{ github.workspace }} - name: "Unpack class result" run: | cd ${{ github.workspace }}/dubbo From 35bc31e373fd881a076af4d934a28e1cddd59186 Mon Sep 17 00:00:00 2001 From: Albumen Kevin Date: Mon, 13 Feb 2023 10:28:24 +0800 Subject: [PATCH 9/9] Update cov --- .github/workflows/build-and-test-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-test-pr.yml b/.github/workflows/build-and-test-pr.yml index e55efed0207..28d9bae045a 100644 --- a/.github/workflows/build-and-test-pr.yml +++ b/.github/workflows/build-and-test-pr.yml @@ -217,7 +217,7 @@ jobs: uses: actions/upload-artifact@v3 with: name: coverage-result - path: "**/target/site/jacoco-aggregate/jacoco.xml" + path: "**/target/site/**/jacoco.xml" integration-test-prepare: runs-on: ubuntu-latest