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

fix ut #4789

Closed
wants to merge 4 commits into from
Closed

fix ut #4789

wants to merge 4 commits into from

Conversation

bobz965
Copy link
Collaborator

@bobz965 bobz965 commented Dec 4, 2024

Pull Request

What type of this PR

Examples of user facing changes:

  • Tests

image

该 ut 创建的资源是唯一的,感觉像是提前删除了资源

Which issue(s) this PR fixes

Fixes #(issue-number)

Signed-off-by: bobz965 <[email protected]>
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. test automation tests labels Dec 4, 2024
@bobz965 bobz965 marked this pull request as draft December 4, 2024 02:38
@bobz965 bobz965 marked this pull request as ready for review December 4, 2024 02:49
@bobz965 bobz965 requested a review from zhangzujian December 4, 2024 02:49
Signed-off-by: bobz965 <[email protected]>
@coveralls
Copy link

coveralls commented Dec 4, 2024

Pull Request Test Coverage Report for Build 12479280975

Details

  • 1 of 5 (20.0%) changed or added relevant lines in 2 files are covered.
  • 3 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.03%) to 22.085%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/controller/node.go 0 4 0.0%
Files with Coverage Reduction New Missed Lines %
pkg/controller/node.go 3 0.0%
Totals Coverage Status
Change from base Build 12477501820: -0.03%
Covered Lines: 10145
Relevant Lines: 45937

💛 - Coveralls

@bobz965 bobz965 requested a review from oilbeater December 5, 2024 05:57
@zhangzujian
Copy link
Member

GetAllChassisByHost() 和 GetChassisByHost() 除了返回值不同外,有什么区别吗?

@zhangzujian
Copy link
Member

如果是 t.Cleanup() 提前执行导致的,为什么日志里只有删除前三个 chassis 的记录?

I1203 07:33:03.841784    3312 ovn-sb-chassis.go:155] delete chassis: {UUID:c78f0e93-5dcd-440a-9b39-84de7f3c8c1a Encaps:[] ExternalIDs:map[vendor:kube-ovn] Hostname:host-1 Name:kube-ovn-chassis-1 NbCfg:0 OtherConfig:map[] TransportZones:[] VtepLogicalSwitches:[]}
I1203 07:33:03.842371    3312 ovn-sb-chassis.go:155] delete chassis: {UUID:c20bad17-6ab8-4e33-9fc7-f307fcf080d5 Encaps:[] ExternalIDs:map[vendor:kube-ovn] Hostname:host-2 Name:kube-ovn-chassis-2 NbCfg:0 OtherConfig:map[] TransportZones:[] VtepLogicalSwitches:[]}
I1203 07:33:03.842879    3312 ovn-sb-chassis.go:155] delete chassis: {UUID:7b10ab9c-7d35-4572-acec-3cedf3c7ffcf Encaps:[] ExternalIDs:map[vendor:other] Hostname:host-none Name:non-kube-ovn-chassis NbCfg:0 OtherConfig:map[] TransportZones:[] VtepLogicalSwitches:[]}

@zhangzujian
Copy link
Member

有空了修改下调用的 require 函数吧,一旦 ut 失败,拿不到有效的信息。

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Dec 5, 2024
@bobz965
Copy link
Collaborator Author

bobz965 commented Dec 5, 2024

GetAllChassisByHost() 和 GetChassisByHost() 除了返回值不同外,有什么区别吗?

删了 GetAllChassisByHost

@bobz965
Copy link
Collaborator Author

bobz965 commented Dec 5, 2024

有空了修改下调用的 require 函数吧,一旦 ut 失败,拿不到有效的信息。

使用 require.Contains ,我后续改一下吧

@bobz965 bobz965 force-pushed the fix-ut branch 3 times, most recently from 7d2a592 to 58c4ba9 Compare December 24, 2024 01:10
Signed-off-by: bobz965 <[email protected]>
@bobz965 bobz965 force-pushed the fix-ut branch 2 times, most recently from e1eeabb to 95c0d27 Compare December 24, 2024 08:22
Signed-off-by: bobz965 <[email protected]>
@bobz965
Copy link
Collaborator Author

bobz965 commented Dec 24, 2024

repost later

@bobz965 bobz965 closed this Dec 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:L This PR changes 100-499 lines, ignoring generated files. test automation tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants