Skip to content

Conversation

@fwiesel
Copy link
Contributor

@fwiesel fwiesel commented Nov 17, 2025

No functional change, just renaming and restructuring of the tests.

  • rename the controller from tc (traits-controller) to controller
  • use k8sClient directly in the test and to make clear we just use a generic k8s-client here.
  • Use DeferCleanup for cleanup
  • Use JustBeforeEach for reconciliation step.
  • Rename the string HypervisorServiceController to HypervisorMaintenanceController as that is the current name.

- Fix the name of the controller
  - tc is copy-pasta from traitscontroller, let's call it controller
  - HypervisorServiceController was only changed in code but not in the string
- Use k8sClient in the tests directly instead of going through the controller
- Move the reconciliation to JustBeforeEach, as we have always have to do that.
@fwiesel fwiesel requested a review from notandy November 17, 2025 16:32
@github-actions
Copy link

Merging this branch will increase overall coverage

Impacted Packages Coverage Δ 🤖
github.com/cobaltcore-dev/openstack-hypervisor-operator/internal/controller 34.76% (+0.20%) 👍

Coverage by file

Changed unit test files

  • github.com/cobaltcore-dev/openstack-hypervisor-operator/internal/controller/hypervisor_maintenance_controller_test.go

@fwiesel fwiesel merged commit 06d108d into main Nov 18, 2025
7 checks passed
@fwiesel fwiesel deleted the HypervisorMaintenanceControllerTestRefactor branch November 18, 2025 08:55
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.

3 participants