Skip to content

[DPE-11496] (PART 12) CI/CD migration to single-kernel: jubilant migration, part 5 - #444

Draft
xavipg003 wants to merge 1 commit into
dpe-11496-11from
dpe-11496-12
Draft

xavipg003 wants to merge 1 commit into
dpe-11496-11from
dpe-11496-12

Conversation

@xavipg003

@xavipg003 xavipg003 commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Description

This PR completes the migration of the PostgreSQL integration test modules from pytest-operator to jubilant. Buils on #440.

It migrates the remaining relations module, test_new_relations_1, in its existing folder.

What's included

  • Migrated to jubilant: new_relations/test_new_relations_1.py.
  • Helpers in charm/helpers.py: start_machine, assert_sync_standbys and check_database_users_existence, retaining the original LXC command, standby retry policy, first-unit selection, SQL and user assertions.
  • Reuse: the existing jubilant connection-string, relation-data, secret, primary, machine and unit-address helpers, plus get_app_leader, fast_forward and wait_for_idle.
  • Scaling: reuses scale_ha_application, preserving the original storage policy and exact-unit idle waits instead of using the general helper that destroys storage on VM scale-down.

How the migration was done

  • Change only what jubilant needs. Keep the original test names, marks, retries, timeouts, checks, SQL and unit selection.
  • Replace ops_test with the synchronous juju fixture and adapt deployment, relations, configuration, commands and status reads to jubilant.
  • Replace deployment and relation-data asyncio.gather calls with sequential calls, and asyncio.sleep with time.sleep.
  • Preserve all wait_for_idle arguments using the existing synchronous compatibility helper. block_until becomes juju.wait with the original timeout and 0.5-second polling.
  • Use base="ubuntu@24.04" for the original series="noble", which is not an argument of jubilant's deployment API.
  • Recover the two cluster relation IDs from typed show_unit data after the original idle wait: select by endpoint and related application, not by relation order. juju.integrate does not return a relation object.
  • Keep the secret assertions previously guarded by hasattr(model, "list_secrets"): the pinned libjuju version has that method, so the original always runs these checks.
  • Preserve the original-unit removal order, leaving the Juju leader until last. No force/no-wait removal workaround is added to this module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant