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

Add unit test for pkg exporter #4195

Merged
merged 1 commit into from
Sep 9, 2022

Conversation

yuntanghsu
Copy link
Contributor

@yuntanghsu yuntanghsu commented Sep 2, 2022

Add unit test for pkg exporter under flowaggregator
For #4142

Signed-off-by: Yun-Tang Hsu hsuy@vmware.com

@codecov
Copy link

codecov bot commented Sep 2, 2022

Codecov Report

Merging #4195 (8610ae4) into main (264aefa) will increase coverage by 2.82%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4195      +/-   ##
==========================================
+ Coverage   58.30%   61.12%   +2.82%     
==========================================
  Files         384      384              
  Lines       54376    54379       +3     
==========================================
+ Hits        31702    33240    +1538     
+ Misses      20257    18702    -1555     
- Partials     2417     2437      +20     
Flag Coverage Δ
e2e-tests 39.43% <ø> (?)
integration-tests 34.85% <ø> (+0.11%) ⬆️
kind-e2e-tests 49.06% <85.71%> (+7.70%) ⬆️
unit-tests 42.21% <42.85%> (+0.26%) ⬆️
Impacted Files Coverage Δ
...lowaggregator/clickhouseclient/clickhouseclient.go 80.48% <100.00%> (+6.89%) ⬆️
pkg/flowaggregator/exporter/clickhouse.go 78.26% <100.00%> (+23.91%) ⬆️
pkg/apiserver/handlers/endpoint/handler.go 56.52% <0.00%> (-13.05%) ⬇️
pkg/controller/grouping/controller.go 65.13% <0.00%> (-1.98%) ⬇️
pkg/ovs/openflow/ofctrl_bridge.go 75.92% <0.00%> (+0.39%) ⬆️
pkg/agent/secondarynetwork/podwatch/controller.go 74.30% <0.00%> (+0.39%) ⬆️
pkg/controller/ipam/validate.go 80.32% <0.00%> (+0.54%) ⬆️
pkg/agent/openflow/network_policy.go 79.36% <0.00%> (+0.65%) ⬆️
pkg/agent/openflow/framework.go 90.64% <0.00%> (+0.71%) ⬆️
pkg/agent/controller/networkpolicy/fqdn.go 74.68% <0.00%> (+0.89%) ⬆️
... and 54 more

@yuntanghsu yuntanghsu force-pushed the ut_flowaggregator_exporter branch from f179b8a to 994e366 Compare September 2, 2022 16:49
pkg/flowaggregator/exporter/s3_test.go Outdated Show resolved Hide resolved
pkg/flowaggregator/exporter/s3_test.go Show resolved Hide resolved
Comment on lines +89 to +94
// PrepareClickHouseConnection is used for unit testing
var (
PrepareClickHouseConnection = func(input ClickHouseInput) (string, *sql.DB, error) {
return PrepareConnection(input)
}
)
Copy link
Contributor

Choose a reason for hiding this comment

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

it's a bit clunky that this needs to be an exported variable, but I understand that there isn't any obvious alternative here...

pkg/flowaggregator/exporter/clickhouse_test.go Outdated Show resolved Hide resolved
@antoninbas antoninbas requested a review from wsquan171 September 6, 2022 17:35
Signed-off-by: Yun-Tang Hsu <hsuy@vmware.com>
@yuntanghsu yuntanghsu force-pushed the ut_flowaggregator_exporter branch from 994e366 to 8610ae4 Compare September 6, 2022 17:47
@yuntanghsu
Copy link
Contributor Author

/test-networkpolicy
/test-e2e
/test-conformance

Copy link
Contributor

@dreamtalen dreamtalen left a comment

Choose a reason for hiding this comment

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

LGTM

@antoninbas antoninbas merged commit 2ce2ef0 into antrea-io:main Sep 9, 2022
heanlan pushed a commit to heanlan/antrea that referenced this pull request Mar 29, 2023
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