Skip to content

Commit

Permalink
feat(workflow): add compiler configuration check to CI pipeline
Browse files Browse the repository at this point in the history
- Added a new step to check if compilers are configured correctly.
- Included steps to redact passwords in `litmus_inventory.yaml`.
- Added steps to retrieve and verify `peadm_config` for primary and compiler nodes.
- Implemented a smoke test to ensure the correct configuration of legacy and current compilers.
  • Loading branch information
CoMfUcIoS committed Sep 24, 2024
1 parent d6a2f0e commit 2d7fc6d
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/test-convert-to-legacy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,32 @@ jobs:
sleep 60
done
echo "${HOME}/pause absent, continuing workflow."
- name: Check if compilers are configured
timeout-minutes: 120
run: |
echo ::group::inventory
sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true
echo ::endgroup::
echo ::group::get_peadm_config
primary=$(yq '.groups[].targets[] | select(.vars.role == "primary") | .name' spec/fixtures/litmus_inventory.yaml)
compiler=$(yq '.groups[].targets[] | select(.vars.role == "compiler") | .name' spec/fixtures/litmus_inventory.yaml | head -n 1)
legacy_compiler=$(yq '.groups[].targets[] | select(.vars.role == "compiler") | .name' spec/fixtures/litmus_inventory.yaml | head -n 2)
bundle exec bolt task run peadm::get_peadm_config \
--targets $primary \
--inventoryfile spec/fixtures/litmus_inventory.yaml \
--modulepath spec/fixtures/modules \
--no-host-key-check \
--format json > peadm_config.json
cat peadm_config.json
echo ::endgroup::
echo ::group::smoke_test
configured_legacy_compiler=$(yq '.items[0].value.params.legacy_compilers[0]' peadm_config.json)
configured_compiler=$(yq '.items[0].value.params.compiler_hosts[0]' peadm_config.json)
if [ "$configured_legacy_compiler" != "$legacy_compiler" AND "$configured_compiler" != "$compiler" ]
echo "Compilers are not configured, expected $legacy_compiler and $compiler, got $configured_legacy_compiler and $configured_compiler"
exit 1
fi
echo ::endgroup::
- name: Tear down test cluster
if: ${{ always() }}
continue-on-error: true
Expand Down

0 comments on commit 2d7fc6d

Please sign in to comment.