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

[Not4Review]Change to include unit test data only #4616

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

luolanzone
Copy link
Contributor

The purpose of this PR is to track latest unit test coverage data on Codecov.

Signed-off-by: Lan Luo [email protected]

@luolanzone luolanzone force-pushed the codecov-ut-only branch 3 times, most recently from a287c05 to b0aa950 Compare February 9, 2023 07:52
@codecov
Copy link

codecov bot commented Feb 9, 2023

Codecov Report

Merging #4616 (b0aa950) into main (6d76ddf) will increase coverage by 1.45%.
The diff coverage is n/a.

❗ Current head b0aa950 differs from pull request most recent head bf9eeb5. Consider uploading reports for the commit bf9eeb5 to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4616      +/-   ##
==========================================
+ Coverage   68.64%   70.10%   +1.45%     
==========================================
  Files         400      376      -24     
  Lines       59450    57192    -2258     
==========================================
- Hits        40809    40092     -717     
+ Misses      15807    14341    -1466     
+ Partials     2834     2759      -75     
Flag Coverage Δ *Carryforward flag
e2e-tests 38.34% <ø> (ø) Carriedforward from 6d76ddf
integration-tests 34.53% <ø> (ø) Carriedforward from 6d76ddf
kind-e2e-tests 40.46% <ø> (ø) Carriedforward from 6d76ddf
unit-tests 60.84% <ø> (+1.08%) ⬆️

*This pull request uses carry forward flags. Click here to find out more.

Impacted Files Coverage Δ
pkg/features/antrea_features.go 64.00% <0.00%> (-36.00%) ⬇️
pkg/apiserver/handlers/endpoint/handler.go 56.52% <0.00%> (-13.05%) ⬇️
cmd/antrea-agent/options.go 31.99% <0.00%> (-4.98%) ⬇️
pkg/util/env/env.go 58.73% <0.00%> (-4.77%) ⬇️
pkg/antctl/runtime/runtime.go 33.33% <0.00%> (-3.34%) ⬇️
...catesigningrequest/ipsec_csr_signing_controller.go 61.65% <0.00%> (-2.46%) ⬇️
pkg/agent/cniserver/ipam/ipam_service.go 81.72% <0.00%> (-2.16%) ⬇️
pkg/controller/externalippool/controller.go 84.37% <0.00%> (-1.79%) ⬇️
pkg/flowaggregator/flowaggregator.go 71.49% <0.00%> (-1.54%) ⬇️
...gent/controller/noderoute/node_route_controller.go 66.91% <0.00%> (-1.37%) ⬇️
... and 29 more

@wenqiq
Copy link
Contributor

wenqiq commented Feb 10, 2023

There is already a branch codecov-ut created by PR #4310 in codecov(https://app.codecov.io/gh/antrea-io/antrea/tree/codecov-ut) and I think it’s not needed to create a new branch just for tracking the latest unit test coverage.

@luolanzone
Copy link
Contributor Author

@wenqiq I think it's better to use a branch in antrea repo instead of a personal branch to track the unit test coverage considering it will be a long running PR. I have also removed unused github workflows to avoid unnecessary runner resource usage. You can update the branch codecov-ut-only in the future directly.

@luolanzone luolanzone force-pushed the codecov-ut-only branch 2 times, most recently from f9b72fc to 2933e97 Compare February 23, 2023 10:16
@rajnkamr rajnkamr force-pushed the codecov-ut-only branch 4 times, most recently from 7792b00 to c001763 Compare March 17, 2023 13:58
@rajnkamr rajnkamr force-pushed the codecov-ut-only branch 2 times, most recently from f3c5e0a to 743ef4c Compare April 6, 2023 05:42
@rajnkamr rajnkamr force-pushed the codecov-ut-only branch 2 times, most recently from 46fe043 to 745523d Compare June 8, 2023 14:52
Comment on lines 21 to 46
test-unit-ubuntu:
needs: check-changes
if: ${{ needs.check-changes.outputs.has_changes == 'yes' }}
name: Unit test (ubuntu-latest)
runs-on: [ubuntu-latest]
steps:
- name: Check-out code
uses: actions/checkout@v3
- name: Set up Go using version from go.mod
uses: actions/setup-go@v4
uses: actions/setup-go@v3
with:
go-version-file: 'go.mod'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Consider using a matrix strategy for the setup-go action to avoid duplicating code for different operating systems.

Suggested change
test-unit-ubuntu:
needs: check-changes
if: ${{ needs.check-changes.outputs.has_changes == 'yes' }}
name: Unit test (ubuntu-latest)
runs-on: [ubuntu-latest]
steps:
- name: Check-out code
uses: actions/checkout@v3
- name: Set up Go using version from go.mod
uses: actions/setup-go@v4
uses: actions/setup-go@v3
with:
go-version-file: 'go.mod'
jobs:
test-unit:
strategy:
matrix:
os: [ubuntu-latest, windows-2019]
name: Unit test (${{ matrix.os }})
runs-on: ${{ matrix.os }}
steps:
- name: Set up Go using version from go.mod
uses: actions/setup-go@v3
with:
go-version-file: 'go.mod'

Comment on lines 31 to 47
- uses: actions/cache@v3
with:
# In order:
# * Module download cache
# * Build cache (Linux)
# * Build cache (Mac)
path: |
~/go/pkg/mod
~/.cache/go-build
~/Library/Caches/go-build
%LocalAppData%\go-build
key: ${{ runner.os }}-${{ env.go-cache-name }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-${{ env.go-cache-name }}-
- name: Run unit tests

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Consider using a matrix strategy for the cache action to avoid duplicating code for different operating systems.

Suggested change
- uses: actions/cache@v3
with:
# In order:
# * Module download cache
# * Build cache (Linux)
# * Build cache (Mac)
path: |
~/go/pkg/mod
~/.cache/go-build
~/Library/Caches/go-build
%LocalAppData%\go-build
key: ${{ runner.os }}-${{ env.go-cache-name }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-${{ env.go-cache-name }}-
- name: Run unit tests
jobs:
test-unit:
strategy:
matrix:
os: [ubuntu-latest, windows-2019]
steps:
- uses: actions/cache@v3
with:
path: |
~/go/pkg/mod
~/.cache/go-build
~/Library/Caches/go-build
%LocalAppData%\go-build
key: ${{ runner.os }}-${{ env.go-cache-name }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-${{ env.go-cache-name }}-

flag_management:
default_rules:
carryforward: true
carryforward: false

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Consider setting 'carryforward' to true to keep the coverage from the last successful commit when a file has no coverage data for the current commit. This can prevent sudden drops in coverage.

Suggested change
carryforward: false
flag_management:
default_rules:
carryforward: true

@luolanzone
Copy link
Contributor Author

This is test message

@rajnkamr rajnkamr force-pushed the codecov-ut-only branch 2 times, most recently from 12e96f4 to e13e355 Compare July 25, 2024 16:09
Signed-off-by: Rajnish K <[email protected]>
Signed-off-by: Lan Luo <[email protected]>
Signed-off-by: Kumar Atish <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants