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

chore: implement new assert function for NAD unit tests #999

Merged
merged 3 commits into from
Jul 24, 2024

Conversation

tobiasgiese
Copy link
Member

@tobiasgiese tobiasgiese commented Jul 18, 2024

Todos:

  • create new assert func
  • adopt for hostdevice network
  • adopt for ipoib
  • adopt for macvlan
  • verify if everything covered (only refactoring necessary IMO)

@coveralls
Copy link
Collaborator

coveralls commented Jul 18, 2024

Pull Request Test Coverage Report for Build 10060390909

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 19 unchanged lines in 5 files lost coverage.
  • Overall coverage increased (+0.1%) to 63.877%

Files with Coverage Reduction New Missed Lines %
pkg/state/state_hostdevice_network.go 2 78.38%
controllers/hostdevicenetwork_controller.go 2 89.77%
controllers/macvlannetwork_controller.go 2 86.25%
pkg/state/state_skel.go 4 83.63%
controllers/nicclusterpolicy_controller.go 9 75.31%
Totals Coverage Status
Change from base Build 9987157196: 0.1%
Covered Lines: 3252
Relevant Lines: 5091

💛 - Coveralls

@tobiasgiese tobiasgiese force-pushed the state-test-nadconfig branch 10 times, most recently from c9ec658 to 3e7c24c Compare July 19, 2024 10:38
@@ -169,6 +193,25 @@ func assertCNIBinDirForDS(u *unstructured.Unstructured) {
}
}

func assertNetworkAttachmentDefinition(c client.Client, expectedNadConfig *nadConfig,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Q: Should we use here GinkgoHelper() or ExpectWithOffset?

Copy link
Member Author

Choose a reason for hiding this comment

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

This would be helpful for sure. We are never using GinkgoHelper or ExpectWithOffset in our tests.
Should we create a separate PR to align our tests?

Copy link
Collaborator

Choose a reason for hiding this comment

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

yes, I think we can update all helper functions in a separate PR

@tobiasgiese tobiasgiese changed the title [WIP] chore: implement new assert function for NAD unit tests chore: implement new assert function for NAD unit tests Jul 22, 2024
e0ne
e0ne previously approved these changes Jul 22, 2024
Copy link
Collaborator

@e0ne e0ne left a comment

Choose a reason for hiding this comment

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

LGTM

rollandf
rollandf previously approved these changes Jul 23, 2024
…testing

Use this new function for the hostdevice network unit tests.

Signed-off-by: Tobias Giese <[email protected]>
@tobiasgiese tobiasgiese dismissed stale reviews from rollandf and e0ne via 8a07cad July 23, 2024 14:01
@tobiasgiese tobiasgiese force-pushed the state-test-nadconfig branch from 3e7c24c to 8a07cad Compare July 23, 2024 14:01
@tobiasgiese
Copy link
Member Author

Had to update the first commit, change is between 3e7c24c and 8a07cad

@tobiasgiese
Copy link
Member Author

/retest-all

@rollandf
Copy link
Member

/retest-copy-right

@rollandf
Copy link
Member

/retest-blackduck_scan

@rollandf
Copy link
Member

/retest-image_scan

@ykulazhenkov ykulazhenkov merged commit 018e662 into Mellanox:master Jul 24, 2024
16 checks passed
@tobiasgiese tobiasgiese deleted the state-test-nadconfig branch July 24, 2024 14:14
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.

5 participants