Skip to content

test: repair proxmox and dynamic service test doubles after renames - #186

Merged
janpenitent merged 1 commit into
v4.0from
fixes/v4.0-proxmox-and-dynamic-tests
Aug 12, 2026
Merged

test: repair proxmox and dynamic service test doubles after renames#186
janpenitent merged 1 commit into
v4.0from
fixes/v4.0-proxmox-and-dynamic-tests

Conversation

@aschumann-virtualcable

Copy link
Copy Markdown
Contributor

Test-only changes. No production code is touched.

What was broken

tests/services/proxmox did not even import:

ImportError: cannot import name 'service_linked' from 'uds.services.Proxmox'

service_linked.py was renamed to service.py (and ProxmoxServiceLinked to ProxmoxService) without updating the fixtures.

With collection restored, five more failures showed up underneath, plus seven in tests/core/services/generics/test_dynamic_service.py that were failing on their own:

Failure Cause
7 x TaskState.ERROR != RUNNING in test_dynamic_service.py The test doubles still declared get_mac(..., force_new=...), renamed to for_unique_id in DynamicService. The TypeError was swallowed and surfaced as an ERROR state
4 x No more MACs available The provider fixture mac range started at 00:00:00:00:00:00, which is the NO_MORE_MACS sentinel, so the first generated mac read as "no macs left". 5.0 already starts at ...:01
test_process_snapshot Asserted name='UDS Snapshot' while the service creates 'UDS_Snapshot'
Network calls from unit tests create_service_linked() built a real provider, and service initialization validates the storage against the API, so the tests reached out to host:8006

What this changes

  • tests/services/proxmox/fixtures.py: import and type references updated; create_mocked_provider() extracted from patched_provider so the create_service_* helpers get a mocked client instead of a real provider; mac range starts at ...:01; private_environment() receives the generated uuid instead of the uuid module.
  • tests/services/proxmox/test_service_fixed.py: snapshot name assertion.
  • tests/core/services/generics/fixtures.py: force_new renamed to for_unique_id in the two get_mac doubles.

Testing

tests/services/proxmox + tests/core/services/generics   ->  74 passed, 32 skipped
tests --ignore=tests/enterprise                         -> 469 passed, 72 skipped, 3 failed

The three remaining failures are unrelated to this branch and come from the enterprise plugin not being wired into this checkout: test_transports_loads_correctly (nicedcvtunneltransport missing), test_jobs_stores_on_db (28 jobs instead of 34) and physical_machines/test_migration::test_migrate.

The proxmox test fixtures still referenced `service_linked.ProxmoxServiceLinked`,
which was renamed to `service.ProxmoxService`, so the whole
tests/services/proxmox package failed to import.

With collection restored, five more failures showed up underneath:

- `DynamicTestingService.get_mac()` still declared `force_new`, renamed to
  `for_unique_id` in DynamicService, so every dynamic userservice deployment
  ended in ERROR state instead of RUNNING.
- The provider fixture mac range started at 00:00:00:00:00:00, which is the
  NO_MORE_MACS sentinel, so the first generated mac was read as "no macs left".
  Range now starts at ...:01, as in 5.0.
- The snapshot name assertion expected 'UDS Snapshot' while the service creates
  'UDS_Snapshot'.
- `create_service_linked()` built a real provider, and service initialization
  validates the storage against the API, so the tests reached out to the network.
  It now builds a provider with the mocked client, same as `patched_provider`.

Also passes the generated uuid to `private_environment()` instead of the uuid
module.

Only test code is touched.
@github-actions
github-actions Bot requested a review from dkmstr August 12, 2026 12:23
@aschumann-virtualcable
aschumann-virtualcable requested review from janpenitent and removed request for dkmstr August 12, 2026 12:28
@janpenitent
janpenitent merged commit 5f14080 into v4.0 Aug 12, 2026
2 checks passed
@janpenitent
janpenitent deleted the fixes/v4.0-proxmox-and-dynamic-tests branch August 12, 2026 12:34
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