Skip to content

[DPE-11496] (PART 10) CI/CD migration to single-kernel: jubilant migration, part 3 - #434

Draft
xavipg003 wants to merge 4 commits into
dpe-11496-9from
dpe-11496-10
Draft

xavipg003 wants to merge 4 commits into
dpe-11496-9from
dpe-11496-10

Conversation

@xavipg003

Copy link
Copy Markdown
Contributor

Description

This PR continues migrating the PostgreSQL integration tests from pytest-operator to jubilant. Builds on #432.

What's included

  • Migrated to jubilant:
    • test_restore_cluster (VM only).
    • test_smoke, test_self_healing_1 and test_self_healing_2 (VM and K8s, keeping their substrate-specific cases and existing skips).
  • Storage and recovery helpers in charm/helpers.py: storage discovery and reuse, adding units with existing storage, database and authentication checks, and PVC/PV recovery on K8s. Reuses scale_ha_application and the continuous-write and cluster helpers from the previous PR.
  • Process helpers in charm/helpers.py: send_signal_to_process, are_all_db_processes_down, is_postgresql_ready, update_restart_condition, copy_file_into_pod and modify_pebble_restart_delay.
  • Fixtures in high_availability/conftest.py: juju_restart_policy, juju_loop_wait and juju_reset_restart_condition, preserving the original Patroni, Pebble and systemd configuration/restoration behaviour. Reuses juju_continuous_writes and juju_primary_start_timeout.
  • Move: the four test modules move unchanged from ha_tests/ to high_availability/, after their migration. Their Spread tasks point to the new paths. The Pebble manifests stay in ha_tests/manifests/.

How the migration was done

  • Change only what jubilant needs. Keep the original test names, marks, parametrizations, skips, retries, timeouts, checks and unit selection.
  • Replace ops_test with the synchronous juju fixture and adapt deployment, relations, commands and status reads to jubilant.
  • Use ThreadPoolExecutor for the original asyncio.gather calls in test_self_healing_2 and its systemd fixture.
  • Preserve libjuju's SCP behaviour in update_restart_condition: 10 attempts, a two-second wait after failures, the ubuntu user and disabled host-key checks.
  • Leave the async helpers and fixtures in place for the remaining migration and later cleanup.

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