From cde8e27326a360c481b98d42c72f5fc66616d00d Mon Sep 17 00:00:00 2001 From: Wenqi Qiu Date: Fri, 30 Sep 2022 09:02:48 +0800 Subject: [PATCH 1/4] unit test coverage Signed-off-by: Wenqi Qiu codecov comment after 2 build Signed-off-by: Wenqi Qiu --- .github/workflows/go.yml | 14 ++-- .github/workflows/kind.yml | 168 ++++++++++++++++++------------------- ci/jenkins/test-mc.sh | 2 +- ci/jenkins/test-vmc.sh | 6 -- codecov.yaml | 14 +--- 5 files changed, 93 insertions(+), 111 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 7cdf3d4621c..6d2937df64b 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -138,13 +138,13 @@ jobs: run: | cd multicluster make test-integration - - name: Codecov - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - files: .coverage/coverage-integration.txt,multicluster/.coverage/coverage-integration.txt - flags: integration-tests - name: codecov-integration-test +# - name: Codecov +# uses: codecov/codecov-action@v3 +# with: +# token: ${{ secrets.CODECOV_TOKEN }} +# files: .coverage/coverage-integration.txt,multicluster/.coverage/coverage-integration.txt +# flags: integration-tests +# name: codecov-integration-test # golangci-lint-ubuntu and golangci-lint-macos are intentionally not merged into one job with os matrix, otherwise the # job wouldn't be expanded if it's skipped and the report of the required check would be missing. diff --git a/.github/workflows/kind.yml b/.github/workflows/kind.yml index 3e51e29d4a5..2ff571f8df0 100644 --- a/.github/workflows/kind.yml +++ b/.github/workflows/kind.yml @@ -98,20 +98,20 @@ jobs: ANTREA_LOG_DIR=$PWD/log ANTREA_COV_DIR=$PWD/test-e2e-encap-coverage ./ci/kind/test-e2e-kind.sh --encap-mode encap --coverage - name: Tar coverage files run: tar -czf test-e2e-encap-coverage.tar.gz test-e2e-encap-coverage - - name: Upload coverage for test-e2e-encap-coverage - uses: actions/upload-artifact@v3 - with: - name: test-e2e-encap-coverage - path: test-e2e-encap-coverage.tar.gz - retention-days: 30 - - name: Codecov - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: '*.cov.out*' - flags: kind-e2e-tests - name: codecov-test-e2e-encap - directory: test-e2e-encap-coverage +# - name: Upload coverage for test-e2e-encap-coverage +# uses: actions/upload-artifact@v3 +# with: +# name: test-e2e-encap-coverage +# path: test-e2e-encap-coverage.tar.gz +# retention-days: 30 +# - name: Codecov +# uses: codecov/codecov-action@v3 +# with: +# token: ${{ secrets.CODECOV_TOKEN }} +# file: '*.cov.out*' +# flags: kind-e2e-tests +# name: codecov-test-e2e-encap +# directory: test-e2e-encap-coverage - name: Tar log files if: ${{ failure() }} run: tar -czf log.tar.gz log @@ -156,20 +156,20 @@ jobs: ANTREA_LOG_DIR=$PWD/log ANTREA_COV_DIR=$PWD/test-e2e-encap-no-proxy-coverage ./ci/kind/test-e2e-kind.sh --encap-mode encap --feature-gates AntreaProxy=false --coverage --skip mode-irrelevant - name: Tar coverage files run: tar -czf test-e2e-encap-no-proxy-coverage.tar.gz test-e2e-encap-no-proxy-coverage - - name: Upload coverage for test-e2e-encap-no-proxy-coverage - uses: actions/upload-artifact@v3 - with: - name: test-e2e-encap-no-proxy-coverage - path: test-e2e-encap-no-proxy-coverage.tar.gz - retention-days: 30 - - name: Codecov - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: '*.cov.out*' - flags: kind-e2e-tests - name: codecov-test-e2e-encap-no-proxy - directory: test-e2e-encap-no-proxy-coverage +# - name: Upload coverage for test-e2e-encap-no-proxy-coverage +# uses: actions/upload-artifact@v3 +# with: +# name: test-e2e-encap-no-proxy-coverage +# path: test-e2e-encap-no-proxy-coverage.tar.gz +# retention-days: 30 +# - name: Codecov +# uses: codecov/codecov-action@v3 +# with: +# token: ${{ secrets.CODECOV_TOKEN }} +# file: '*.cov.out*' +# flags: kind-e2e-tests +# name: codecov-test-e2e-encap-no-proxy +# directory: test-e2e-encap-no-proxy-coverage - name: Tar log files if: ${{ failure() }} run: tar -czf log.tar.gz log @@ -215,20 +215,20 @@ jobs: ANTREA_LOG_DIR=$PWD/log ANTREA_COV_DIR=$PWD/test-e2e-encap-all-features-enabled-coverage ./ci/kind/test-e2e-kind.sh --encap-mode encap --coverage --feature-gates AllAlpha=true,AllBeta=true,Multicast=false --proxy-all - name: Tar coverage files run: tar -czf test-e2e-encap-all-features-enabled-coverage.tar.gz test-e2e-encap-all-features-enabled-coverage - - name: Upload coverage for test-e2e-encap-all-features-enabled-coverage - uses: actions/upload-artifact@v3 - with: - name: test-e2e-encap-all-features-enabled-coverage - path: test-e2e-encap-all-features-enabled-coverage.tar.gz - retention-days: 30 - - name: Codecov - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: '*.cov.out*' - flags: kind-e2e-tests - name: codecov-test-e2e-encap-all-features-enabled - directory: test-e2e-encap-all-features-enabled-coverage +# - name: Upload coverage for test-e2e-encap-all-features-enabled-coverage +# uses: actions/upload-artifact@v3 +# with: +# name: test-e2e-encap-all-features-enabled-coverage +# path: test-e2e-encap-all-features-enabled-coverage.tar.gz +# retention-days: 30 +# - name: Codecov +# uses: codecov/codecov-action@v3 +# with: +# token: ${{ secrets.CODECOV_TOKEN }} +# file: '*.cov.out*' +# flags: kind-e2e-tests +# name: codecov-test-e2e-encap-all-features-enabled +# directory: test-e2e-encap-all-features-enabled-coverage - name: Tar log files if: ${{ failure() }} run: tar -czf log.tar.gz log @@ -273,20 +273,20 @@ jobs: ANTREA_LOG_DIR=$PWD/log ANTREA_COV_DIR=$PWD/test-e2e-noencap-coverage ./ci/kind/test-e2e-kind.sh --encap-mode noEncap --coverage --skip mode-irrelevant - name: Tar coverage files run: tar -czf test-e2e-noencap-coverage.tar.gz test-e2e-noencap-coverage - - name: Upload coverage for test-e2e-noencap-coverage - uses: actions/upload-artifact@v3 - with: - name: test-e2e-noencap-coverage - path: test-e2e-noencap-coverage.tar.gz - retention-days: 30 - - name: Codecov - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: '*.cov.out*' - flags: kind-e2e-tests - name: codecov-test-e2e-noencap - directory: test-e2e-noencap-coverage +# - name: Upload coverage for test-e2e-noencap-coverage +# uses: actions/upload-artifact@v3 +# with: +# name: test-e2e-noencap-coverage +# path: test-e2e-noencap-coverage.tar.gz +# retention-days: 30 +# - name: Codecov +# uses: codecov/codecov-action@v3 +# with: +# token: ${{ secrets.CODECOV_TOKEN }} +# file: '*.cov.out*' +# flags: kind-e2e-tests +# name: codecov-test-e2e-noencap +# directory: test-e2e-noencap-coverage - name: Tar log files if: ${{ failure() }} run: tar -czf log.tar.gz log @@ -331,20 +331,20 @@ jobs: ANTREA_LOG_DIR=$PWD/log ANTREA_COV_DIR=$PWD/test-e2e-hybrid-coverage ./ci/kind/test-e2e-kind.sh --encap-mode hybrid --coverage --skip mode-irrelevant - name: Tar coverage files run: tar -czf test-e2e-hybrid-coverage.tar.gz test-e2e-hybrid-coverage - - name: Upload coverage for test-e2e-hybrid-coverage - uses: actions/upload-artifact@v3 - with: - name: test-e2e-hybrid-coverage - path: test-e2e-hybrid-coverage.tar.gz - retention-days: 30 - - name: Codecov - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: '*.cov.out*' - flags: kind-e2e-tests - name: codecov-test-e2e-hybrid - directory: test-e2e-hybrid-coverage +# - name: Upload coverage for test-e2e-hybrid-coverage +# uses: actions/upload-artifact@v3 +# with: +# name: test-e2e-hybrid-coverage +# path: test-e2e-hybrid-coverage.tar.gz +# retention-days: 30 +# - name: Codecov +# uses: codecov/codecov-action@v3 +# with: +# token: ${{ secrets.CODECOV_TOKEN }} +# file: '*.cov.out*' +# flags: kind-e2e-tests +# name: codecov-test-e2e-hybrid +# directory: test-e2e-hybrid-coverage - name: Tar log files if: ${{ failure() }} run: tar -czf log.tar.gz log @@ -396,20 +396,20 @@ jobs: ANTREA_LOG_DIR=$PWD/log ANTREA_COV_DIR=$PWD/test-e2e-fa-coverage ./ci/kind/test-e2e-kind.sh --encap-mode encap --coverage --flow-visibility - name: Tar coverage files run: tar -czf test-e2e-fa-coverage.tar.gz test-e2e-fa-coverage - - name: Upload coverage for test-e2e-fa-coverage - uses: actions/upload-artifact@v3 - with: - name: test-e2e-fa-coverage - path: test-e2e-fa-coverage.tar.gz - retention-days: 30 - - name: Codecov - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: '*.cov.out*' - flags: kind-e2e-tests - name: codecov-test-e2e-fa - directory: test-e2e-fa-coverage +# - name: Upload coverage for test-e2e-fa-coverage +# uses: actions/upload-artifact@v3 +# with: +# name: test-e2e-fa-coverage +# path: test-e2e-fa-coverage.tar.gz +# retention-days: 30 +# - name: Codecov +# uses: codecov/codecov-action@v3 +# with: +# token: ${{ secrets.CODECOV_TOKEN }} +# file: '*.cov.out*' +# flags: kind-e2e-tests +# name: codecov-test-e2e-fa +# directory: test-e2e-fa-coverage - name: Tar log files if: ${{ failure() }} run: tar -czf log.tar.gz log diff --git a/ci/jenkins/test-mc.sh b/ci/jenkins/test-mc.sh index a8bd6ffd810..d14d6eab78e 100755 --- a/ci/jenkins/test-mc.sh +++ b/ci/jenkins/test-mc.sh @@ -243,7 +243,7 @@ function run_codecov { (set -e shasum -a 256 -c codecov.SHA256SUM chmod +x codecov - ./codecov -c -t ${CODECOV_TOKEN} -F ${flag} -f ${file} -s ${dir} -C ${GIT_COMMIT} -r antrea-io/antrea + #./codecov -c -t ${CODECOV_TOKEN} -F ${flag} -f ${file} -s ${dir} -C ${GIT_COMMIT} -r antrea-io/antrea rm -f trustedkeys.gpg codecov )} diff --git a/ci/jenkins/test-vmc.sh b/ci/jenkins/test-vmc.sh index 6837548b354..ab641801077 100755 --- a/ci/jenkins/test-vmc.sh +++ b/ci/jenkins/test-vmc.sh @@ -326,12 +326,6 @@ function run_codecov { (set -e chmod +x codecov - if [[ $remote == true ]]; then - ${SCP_WITH_UTILS_KEY} codecov jenkins@${ip}:~ - ${SSH_WITH_UTILS_KEY} -n jenkins@${ip} "cd antrea; ~/codecov -c -t ${CODECOV_TOKEN} -F ${flag} -f ${file} -C ${GIT_COMMIT} -r antrea-io/antrea" - else - ./codecov -c -t ${CODECOV_TOKEN} -F ${flag} -f ${file} -s ${dir} -C ${GIT_COMMIT} -r antrea-io/antrea - fi rm -f trustedkeys.gpg codecov )} diff --git a/codecov.yaml b/codecov.yaml index e946dd107ae..0a250b66223 100644 --- a/codecov.yaml +++ b/codecov.yaml @@ -8,7 +8,7 @@ comment: require_changes: no require_base: no require_head: no - after_n_builds: 1 + after_n_builds: 2 show_carryforward_flags: true github_checks: @@ -31,18 +31,6 @@ coverage: target: auto flags: - unit-tests - antrea-integration-tests: - target: auto - flags: - - integration-tests - antrea-e2e-tests: - target: auto - flags: - - e2e-tests - antrea-kind-e2e-tests: - target: auto - flags: - - kind-e2e-tests flag_management: default_rules: From a5e445b2f54ea0a4749d6ec7058e20515c86e5bd Mon Sep 17 00:00:00 2001 From: Wenqi Qiu Date: Wed, 19 Oct 2022 08:58:05 +0800 Subject: [PATCH 2/4] diable carryforward Signed-off-by: Wenqi Qiu --- codecov.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/codecov.yaml b/codecov.yaml index 0a250b66223..a1fc7a490e4 100644 --- a/codecov.yaml +++ b/codecov.yaml @@ -9,7 +9,7 @@ comment: require_base: no require_head: no after_n_builds: 2 - show_carryforward_flags: true + show_carryforward_flags: false github_checks: annotations: true @@ -34,7 +34,7 @@ coverage: flag_management: default_rules: - carryforward: true + carryforward: false ignore: - "**/testing/*.go" From 4e62ea539e3e1b1f282232ede5a69d65d277b10d Mon Sep 17 00:00:00 2001 From: Wenqi Qiu Date: Mon, 24 Oct 2022 10:22:56 +0800 Subject: [PATCH 3/4] comments set false Signed-off-by: Wenqi Qiu --- codecov.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/codecov.yaml b/codecov.yaml index a1fc7a490e4..ec549fe36df 100644 --- a/codecov.yaml +++ b/codecov.yaml @@ -2,14 +2,14 @@ codecov: branch: main require_ci_to_pass: no -comment: - layout: "reach,diff,flags,tree" - behavior: default - require_changes: no - require_base: no - require_head: no - after_n_builds: 2 - show_carryforward_flags: false +comment: false +# layout: "reach,diff,flags,tree" +# behavior: default +# require_changes: no +# require_base: no +# require_head: no +# after_n_builds: 2 +# show_carryforward_flags: false github_checks: annotations: true From 4f1221e1c30ffb2acc70ea043f5f74720559f7e2 Mon Sep 17 00:00:00 2001 From: Wenqi Qiu Date: Mon, 24 Oct 2022 18:11:05 +0800 Subject: [PATCH 4/4] test unit linux Signed-off-by: Wenqi Qiu --- .github/workflows/go.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 6d2937df64b..46a677f3ddd 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -96,13 +96,13 @@ jobs: ${{ runner.os }}-${{ env.go-cache-name }}- - name: Run unit tests run: make test-unit - - name: Codecov - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: .coverage/coverage-unit.txt - flags: unit-tests - name: codecov-unit-test +# - name: Codecov +# uses: codecov/codecov-action@v3 +# with: +# token: ${{ secrets.CODECOV_TOKEN }} +# file: .coverage/coverage-unit.txt +# flags: unit-tests +# name: codecov-unit-test test-integration: needs: check-changes