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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

fix ut #4789

wants to merge 3 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

Pull Request Test Coverage Report for Build 12157403622

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 18.678%

Totals Coverage Status
Change from base Build 12153017747: 0.0%
Covered Lines: 8682
Relevant Lines: 46482

💛 - 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

Signed-off-by: bobz965 <[email protected]>
@bobz965
Copy link
Collaborator Author

bobz965 commented Dec 5, 2024

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

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

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