antrea icon indicating copy to clipboard operation
antrea copied to clipboard

Fix running NPL unit test on MacOS

Open XinShuYang opened this issue 2 years ago • 9 comments

Add a portcache file to support go building across different OSs.

issue #3826

Signed-off-by: Shuyang Xin [email protected]

XinShuYang avatar Jun 27 '22 14:06 XinShuYang

/test-all

XinShuYang avatar Jun 27 '22 14:06 XinShuYang

Codecov Report

Merging #3945 (0cc3aac) into main (024254d) will decrease coverage by 25.70%. The diff coverage is 57.69%.

:exclamation: Current head 0cc3aac differs from pull request most recent head d024004. Consider uploading reports for the commit d024004 to get more accurate results

Impacted file tree graph

@@             Coverage Diff             @@
##             main    #3945       +/-   ##
===========================================
- Coverage   67.51%   41.81%   -25.71%     
===========================================
  Files         297      380       +83     
  Lines       44988    56225    +11237     
===========================================
- Hits        30373    23508     -6865     
- Misses      12238    30456    +18218     
+ Partials     2377     2261      -116     
Flag Coverage Δ
e2e-tests 44.69% <57.69%> (?)
integration-tests 35.22% <ø> (-0.14%) :arrow_down:
kind-e2e-tests ?
unit-tests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...agent/nodeportlocal/portcache/port_table_others.go 57.69% <57.69%> (ø)
pkg/ipfix/ipfix_process.go 0.00% <0.00%> (-100.00%) :arrow_down:
pkg/ipfix/ipfix_registry.go 0.00% <0.00%> (-100.00%) :arrow_down:
pkg/agent/openflow/pipeline_other.go 3.84% <0.00%> (-96.16%) :arrow_down:
.../agent/flowexporter/priorityqueue/priorityqueue.go 0.00% <0.00%> (-93.34%) :arrow_down:
pkg/ipfix/ipfix_intermediate.go 0.00% <0.00%> (-90.91%) :arrow_down:
pkg/controller/networkpolicy/endpoint_querier.go 4.58% <0.00%> (-88.08%) :arrow_down:
pkg/agent/flowexporter/connections/conntrack.go 0.00% <0.00%> (-85.72%) :arrow_down:
.../agent/flowexporter/connections/conntrack_linux.go 0.00% <0.00%> (-85.49%) :arrow_down:
pkg/util/flowexport/flowexport.go 0.00% <0.00%> (-84.62%) :arrow_down:
... and 327 more

codecov-commenter avatar Jun 27 '22 14:06 codecov-commenter

/test-all

XinShuYang avatar Jun 27 '22 17:06 XinShuYang

golangci-lint(macos-latest) will fail if we only rename port_table_linux.go to port_table_others.go. So add port_table_others.go to handle situations other than linux and windows environment.

XinShuYang avatar Jun 27 '22 17:06 XinShuYang

I'd rather merge #3936 first and then see what else we need to do

Sure, #3936 is also ready for review.

XinShuYang avatar Jun 28 '22 16:06 XinShuYang

/test-all /test-windows-all

XinShuYang avatar Aug 10 '22 14:08 XinShuYang

/test-all /test-windows-all

XinShuYang avatar Aug 11 '22 01:08 XinShuYang

/test-e2e

XinShuYang avatar Aug 11 '22 05:08 XinShuYang

I don't think we should add a brand new port_table file just to run unit tests on macOS. Why don't we use the Linux one?

Updated. I think we should update the name of port_table_linux.go to port_table_others.go because it also contains code for macOS.

XinShuYang avatar Aug 12 '22 00:08 XinShuYang

Updated commit message

XinShuYang avatar Aug 16 '22 02:08 XinShuYang

/test-all /test-windows-all

XinShuYang avatar Aug 17 '22 06:08 XinShuYang

/test-e2e

XinShuYang avatar Aug 17 '22 08:08 XinShuYang

/test-windows-e2e

XinShuYang avatar Aug 17 '22 11:08 XinShuYang

/test-all

XinShuYang avatar Aug 17 '22 14:08 XinShuYang

/test-conformance

XinShuYang avatar Aug 17 '22 14:08 XinShuYang

/test-e2e

XinShuYang avatar Aug 17 '22 15:08 XinShuYang