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

Codecov ut cni #58

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
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
30 changes: 9 additions & 21 deletions codecov.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: 1
show_carryforward_flags: true
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
Expand All @@ -31,22 +31,10 @@ 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:
carryforward: true
carryforward: false

ignore:
- "**/testing/*.go"
Expand Down
1 change: 1 addition & 0 deletions hack/update-codegen-dockerized.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ ANTREA_PROTO_PKG="antrea_io.antrea"
function generate_mocks {
# Generate mocks for testing with mockgen.
MOCKGEN_TARGETS=(
"pkg/agent/cniserver SriovNet testing"
"pkg/agent/cniserver/ipam IPAMDriver testing"
"pkg/agent/flowexporter/connections ConnTrackDumper,NetFilterConnTrack testing"
"pkg/agent/interfacestore InterfaceStore testing"
Expand Down
4 changes: 2 additions & 2 deletions pkg/agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ func (i *Initializer) initInterfaceStore() error {
}
case interfacestore.AntreaContainer:
// The port should be for a container interface.
intf = cniserver.ParseOVSPortInterfaceConfig(port, ovsPort, true)
intf = cniserver.ParseOVSPortInterfaceConfig(port, ovsPort)
case interfacestore.AntreaTrafficControl:
intf = trafficcontrol.ParseTrafficControlInterfaceConfig(port, ovsPort)
if err := ovsCtlClient.SetPortNoFlood(int(ovsPort.OFPort)); err != nil {
Expand Down Expand Up @@ -354,7 +354,7 @@ func (i *Initializer) initInterfaceStore() error {
antreaIFType = interfacestore.AntreaHost
default:
// The port should be for a container interface.
intf = cniserver.ParseOVSPortInterfaceConfig(port, ovsPort, true)
intf = cniserver.ParseOVSPortInterfaceConfig(port, ovsPort)
antreaIFType = interfacestore.AntreaContainer
}
updatedExtIDs := make(map[string]interface{})
Expand Down
Loading