Skip to content

Commit

Permalink
(PIE-1595) Testing Matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
coreymbe committed Oct 24, 2024
1 parent 7d66010 commit 983bb36
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 16 deletions.
32 changes: 19 additions & 13 deletions .github/workflows/latest_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ jobs:
name: "Setup Test Matrix"
runs-on: ubuntu-20.04
outputs:
matrix: ${{ steps.build-matrix.outputs.matrix }}
platforms: ${{ steps.build-matrix.outputs.matrix.platforms }}
collection: ${{ steps.set-matrix.outputs.pe_latest }}

steps:
- name: Checkout Source
Expand All @@ -34,27 +35,32 @@ jobs:
- name: Set latest release
id: latest_release
run: |
out=$(jq -c '[.[] | select(.lts == false)][0].latest | {"collection": [.]}' <<<'${{ steps.curl_forge.outputs.forge_response }}')
out=$(jq -c '[.[] | select(.lts == false)][0].latest | {"pe_version": [.]}' <<<'${{ steps.curl_forge.outputs.forge_response }}')
echo "latest=$out" >> $GITHUB_OUTPUT
- name: Setup Spec Test Matrix
id: set-matrix
- name: Build Test Matrix
id: build-matrix
run: |
echo "matrix={\"platforms\":[\"rhel-8\",\"rhel-9\",\"sles-15\",\"ubuntu-2204-lts\"]}" >> $GITHUB_OUTPUT
bundle exec matrix_from_metadata_v3 \
--provision-exclude docker \
--arch-exclude arm \
--platform-exclude debian \
--platform-exclude sles
- name: Setup Acceptance Test Matrix
id: build-matrix
id: set-matrix
run: |
out=$(echo '${{ steps.set-matrix.outputs.matrix }}' | jq -c --argjson latest '${{ steps.latest_release.outputs.latest }}' '.collection += $latest.collection')
echo "matrix=$out" >> $GITHUB_OUTPUT
out=$(jq -c --argjson latest '${{ steps.latest_release.outputs.latest }}' '.pe_version += $latest.pe_version')
echo "pe_latest=$out" >> $GITHUB_OUTPUT
Integration:
name: "${{matrix.platforms}}, ${{matrix.collection}}"
name: "${{matrix.platforms.label}}, ${{matrix.pe_version}}"
needs:
- setup_matrix
if: ${{ needs.setup_matrix.outputs.matrix != '{}' }}

runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix: ${{fromJson(needs.setup_matrix.outputs.matrix)}}
matrix:
platforms: ${{ fromJson(needs.setup_matrix.outputs.platforms) }}
pe_version: ${{ fromJson(needs.setup_matrix.outputs.collection) }}

steps:
- name: Checkout Source
Expand All @@ -78,7 +84,7 @@ jobs:
echo ::endgroup::
- name: Provision test environment
run: |
bundle exec bolt --modulepath spec/fixtures/modules plan run splunk_hec::acceptance::provision_machines using='provision_service' image='${{ matrix.platforms }}'
bundle exec bolt --modulepath spec/fixtures/modules plan run splunk_hec::acceptance::provision_machines using='provision_service' image='${{ matrix.platforms.image }}'
echo ::group::=== REQUEST ===
cat request.json || true
echo
Expand All @@ -96,7 +102,7 @@ jobs:
echo INVENTORY_PATH=$FILE >> $GITHUB_ENV
- name: Install server
run: |
bundle exec bolt --modulepath spec/fixtures/modules plan run splunk_hec::acceptance::server_setup puppet_version='${{ matrix.collection }}' -i ./$INVENTORY_PATH --stream
bundle exec bolt --modulepath spec/fixtures/modules plan run splunk_hec::acceptance::server_setup puppet_version='${{ matrix.pe_version }}' -i ./$INVENTORY_PATH --stream
- name: Install module
run: |
bundle exec rake 'litmus:install_module'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lts_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- name: Setup Spec Test Matrix
id: set-matrix
run: |
echo "matrix={\"platforms\":[\"rhel-8\",\"rhel-9\",\"sles-15\",\"ubuntu-2204-lts\"]}" >> $GITHUB_OUTPUT
echo "matrix={\"platforms\":[\"rhel-8\",\"rhel-9\",\"ubuntu-2004-lts\"]}" >> $GITHUB_OUTPUT
- name: Setup Acceptance Test Matrix
id: build-matrix
run: |
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/nightly_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ jobs:
- name: Get Test Matrix
id: get-matrix
run: |
bundle exec matrix_from_metadata_v3 --provision-include provision_service --output stdout
bundle exec matrix_from_metadata_v3
- name: Set nightly releases
id: nightly_release
Expand All @@ -40,7 +39,7 @@ jobs:
- name: Setup Spec Test Matrix
id: set-matrix
run: |
echo "matrix={\"platforms\":[\"rhel-8\",\"rhel-9\",\"sles-15\",\"ubuntu-2204-lts\"]}" >> $GITHUB_OUTPUT
echo "matrix={\"platforms\":[\"rhel-8\",\"rhel-9\",\"ubuntu-2204-lts\"]}" >> $GITHUB_OUTPUT
- name: Setup Acceptance Test Matrix
id: build-matrix
run: |
Expand Down
1 change: 1 addition & 0 deletions plans/acceptance/pe_server_setup.pp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
)

$cmd = @("CMD")
df -h
echo 'puppetlabsPi3!' | puppet access login -l 1y --username admin
puppet infrastructure tune | sed "s,\\x1B\\[[0-9;]*[a-zA-Z],,g" > /etc/puppetlabs/code/environments/production/data/common.yaml
puppet agent -t
Expand Down

0 comments on commit 983bb36

Please sign in to comment.