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 e2e tests for Prefix #161

Merged
merged 1 commit into from
Dec 12, 2024
Merged

Add e2e tests for Prefix #161

merged 1 commit into from
Dec 12, 2024

Conversation

henrybear327
Copy link
Collaborator

@henrybear327 henrybear327 commented Dec 10, 2024

Leveraging Chainsaw, we can easily write e2e tests for the NetBox operator, testing directly against the NetBox instance

This PR focuses solely on the Prefix and PrefixClaim, happy path.

Implements #163

@henrybear327 henrybear327 self-assigned this Dec 10, 2024
@henrybear327 henrybear327 force-pushed the demo/e2e_tests branch 7 times, most recently from 2d80bf7 to f0beacd Compare December 10, 2024 22:16
@henrybear327
Copy link
Collaborator Author

henrybear327 commented Dec 10, 2024

The happy path written are

  • apply the CR with parentPrefix and see if it works (IPv4 only)
  • apply -> delete -> apply and see if the restoration works (IPv4 only)
  • apply the CR with parentPrefixSelector and see if it works (IPv4 and IPv6)

@henrybear327 henrybear327 force-pushed the demo/e2e_tests branch 2 times, most recently from 4ca1f10 to a299551 Compare December 11, 2024 09:42
@henrybear327
Copy link
Collaborator Author

The e2e test run is consistently running around 8.5 min (https://github.com/netbox-community/netbox-operator/actions/runs/12273670479/job/34244939819?pr=161)

The main time is spent on setting things up...

@henrybear327 henrybear327 force-pushed the demo/e2e_tests branch 3 times, most recently from 62c84ed to 458cfb2 Compare December 12, 2024 12:26
@henrybear327
Copy link
Collaborator Author

henrybear327 commented Dec 12, 2024

@bruelea commented that we shouldn't load demo data for e2e tests

@henrybear327
Copy link
Collaborator Author

@bruelea commented that we shouldn't load demo data for e2e tests

This is a lot more work than expected, since we need to extract the minimal tables to set up, etc. Propose to have it done in a follow-up PR. WDYT?

Thanks

Copy link
Collaborator

@bruelea bruelea left a comment

Choose a reason for hiding this comment

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

Nice work! Great to be able to test against an NetBox instance in the kind cluster.

@henrybear327 henrybear327 merged commit 51f16ae into main Dec 12, 2024
6 checks passed
@henrybear327 henrybear327 deleted the demo/e2e_tests branch December 12, 2024 14:36
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.

2 participants