Skip to content

Commit

Permalink
PE-39228 add_replica smoke test (#497)
Browse files Browse the repository at this point in the history
* PE-39228 Smoke test created and added to workflow

* PE-39228 Workflow updated

* PE-39228 Spec updated, smoke test added to matrix

* PE-39228 Versions updated, push trigger removed from matrix

* PE-39228 whitespace fixed
  • Loading branch information
AaronShannon authored Sep 10, 2024
1 parent 8802e03 commit 47d45a1
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 3 deletions.
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}")
}
}

0 comments on commit 47d45a1

Please sign in to comment.