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

PE-39228 add_replica smoke test #497

Merged
merged 5 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/test-add-replica-matrix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
fail-fast: false
matrix:
architecture: [standard, standard-with-dr, large, extra-large]
version: [2021.7.7, 2023.6.0]
version: [2021.7.9, 2023.8.0]
image: [almalinux-cloud/almalinux-8]
steps:
- name: Checkout Source
Expand Down Expand Up @@ -92,6 +92,12 @@ jobs:
--inventoryfile spec/fixtures/litmus_inventory.yaml \
--modulepath spec/fixtures/modules \
--stream
- name: Verify that replica was added
timeout-minutes: 10
run: |
bundle exec bolt plan run peadm_spec::verify_replica -v \
--inventoryfile spec/fixtures/litmus_inventory.yaml \
--modulepath spec/fixtures/modules
- name: Tear down test cluster
if: ${{ always() }}
continue-on-error: true
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/test-add-replica.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
version:
description: PE version to install
required: true
default: 2021.7.8
default: 2021.7.9
ssh-debugging:
description: Boolean; whether or not to pause for ssh debugging
required: true
Expand Down Expand Up @@ -84,14 +84,21 @@ jobs:
--modulepath spec/fixtures/modules \
architecture=${{ matrix.architecture }} \
version=${{ matrix.version }} \
console_password=${{ secrets.CONSOLE_PASSWORD }}
console_password=${{ secrets.CONSOLE_PASSWORD }} \
code_manager_auto_configure=true
- name: Run add_replica plan
timeout-minutes: 60
run: |
bundle exec bolt plan run peadm_spec::add_replica -v \
--inventoryfile spec/fixtures/litmus_inventory.yaml \
--modulepath spec/fixtures/modules \
--stream
- name: Verify that replica was added
timeout-minutes: 10
run: |
bundle exec bolt plan run peadm_spec::verify_replica -v \
--inventoryfile spec/fixtures/litmus_inventory.yaml \
--modulepath spec/fixtures/modules
- name: Wait as long as the file ${HOME}/pause file is present
if: ${{ always() && github.event.inputs.ssh-debugging == 'true' }}
run: |
Expand Down
20 changes: 20 additions & 0 deletions spec/acceptance/peadm_spec/plans/verify_replica.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
plan peadm_spec::verify_replica() {
$t = get_targets('*')
wait_until_available($t)

$primary_host = $t.filter |$n| { $n.vars['role'] == 'primary' }

if $primary_host == [] {
fail_plan('"primary" role missing from inventory, cannot continue')
}

$result = run_task('peadm::get_peadm_config', $primary_host, '_catch_errors' => true).first.to_data()

$replica_host = $result['value']['params']['replica_host']

if $replica_host == undef or $replica_host == null {
fail_plan("No replica was found in the PE configuration")
} else {
out::message("Replica added successfully: ${replica_host}")
}
}
Loading