Skip to content

Commit

Permalink
unit test coverage
Browse files Browse the repository at this point in the history
Signed-off-by: Wenqi Qiu <[email protected]>
  • Loading branch information
wenqiq committed Oct 18, 2022
1 parent 3e6d26b commit 42e8a50
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 110 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
168 changes: 84 additions & 84 deletions .github/workflows/kind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ci/jenkins/test-mc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
)}
Expand Down
6 changes: 0 additions & 6 deletions ci/jenkins/test-vmc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
)}

Expand Down
12 changes: 0 additions & 12 deletions codecov.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 42e8a50

Please sign in to comment.