2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"settings": {
"terminal.integrated.profiles.linux": {
"bash": {
"path": "bash",
"path": "bash"
}
}
},
Expand Down
12 changes: 12 additions & 0 deletions .fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
fixtures:
forge_modules:
# stdlib: "puppetlabs/stdlib"
service: "puppetlabs/service"
package: "puppetlabs/package"
reboot: "puppetlabs/reboot"
repositories:
facts: 'https://github.com/puppetlabs/puppetlabs-facts'
puppet_agent: 'https://github.com/puppetlabs/puppetlabs-puppet_agent'
Expand All @@ -13,3 +16,12 @@ fixtures:
ruby_task_helper: 'https://git@github.com/puppetlabs/puppetlabs-ruby_task_helper'
stdlib: 'https://github.com/puppetlabs/puppetlabs-stdlib'
deploy_pe: 'https://github.com/jarretlavallee/puppet-deploy_pe'
node_manager: 'https://github.com/MartyEwings/puppet-node_manager.git'
apply_helpers: 'https://github.com/puppetlabs/puppetlabs-apply_helpers'
bolt_shim: 'https://github.com/puppetlabs/puppetlabs-bolt_shim'
debug: 'https://github.com/nwops/puppet-debug'
format: 'https://github.com/voxpupuli/puppet-format'
container_inventory: 'https://gitlab.com/nwops/bolt-container_inventory'
peadm: 'https://github.com/puppetlabs/puppetlabs-peadm.git'
symlinks:
peadm_spec: "#{source_dir}/spec/fixtures/modules/peadm/spec/acceptance/peadm_spec/"
28 changes: 5 additions & 23 deletions .github/workflows/auto_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ on:
workflow_dispatch:

env:
HONEYCOMB_WRITEKEY: 7f3c63a70eecc61d635917de46bea4e6
HONEYCOMB_DATASET: litmus tests
CHANGELOG_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
Expand All @@ -14,43 +12,31 @@ jobs:
runs-on: ubuntu-20.04

steps:
- name: "Honeycomb: Start recording"
uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1
with:
apikey: ${{ env.HONEYCOMB_WRITEKEY }}
dataset: ${{ env.HONEYCOMB_DATASET }}
job-status: ${{ job.status }}

- name: "Honeycomb: start first step"
run: |
echo STEP_ID="auto-release" >> $GITHUB_ENV
echo STEP_START=$(date +%s) >> $GITHUB_ENV
- name: "Checkout Source"
if: ${{ github.repository_owner == 'puppetlabs' }}
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false

- name: "PDK Release prep"
uses: docker://puppet/iac_release:ci
uses: docker://puppet/puppet-dev-tools:4.x
with:
args: 'release prep --force'
args: 'pdk release prep --force --debug'
env:
CHANGELOG_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: "Get Version"
if: ${{ github.repository_owner == 'puppetlabs' }}
id: gv
run: |
echo "::set-output name=ver::$(jq --raw-output .version metadata.json)"
echo "ver=$(jq --raw-output .version metadata.json)" >> $GITHUB_OUTPUT
- name: "Check if a release is necessary"
if: ${{ github.repository_owner == 'puppetlabs' }}
id: check
run: |
git diff --quiet CHANGELOG.md && echo "::set-output name=release::false" || echo "::set-output name=release::true"
git diff --quiet CHANGELOG.md && echo "release=false" >> $GITHUB_OUTPUT || echo "release=true" >> $GITHUB_OUTPUT
- name: "Commit changes"
if: ${{ github.repository_owner == 'puppetlabs' && steps.check.outputs.release == 'true' }}
Expand Down Expand Up @@ -84,7 +70,3 @@ jobs:
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
- name: "Honeycomb: Record finish step"
if: ${{ always() }}
run: |
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Finished auto release workflow'
18 changes: 18 additions & 0 deletions .github/workflows/call_nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Call nightly testing workflows

on:
workflow_dispatch:
schedule:
- cron: '25 5 * * 3'

jobs:
spec_testing:
name: "Spec testing"
uses: ./.github/workflows/spec.yml

nightly_testing:
if: github.repository != 'puppetlabs/puppetlabs-bash_task_helper' && github.repository != 'puppetlabs/puppetlabs-puppet_operations_appliance'
name: "PE Nightly Testing"
needs: spec_testing
uses: ./.github/workflows/pe_nightly_testing.yml
secrets: inherit
100 changes: 16 additions & 84 deletions .github/workflows/pe_latest_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ on:
workflow_dispatch:
workflow_call:

env:
HONEYCOMB_WRITEKEY: 7f3c63a70eecc61d635917de46bea4e6
HONEYCOMB_DATASET: litmus tests

jobs:
setup_matrix:
name: "Setup Test Matrix"
Expand All @@ -16,19 +12,8 @@ jobs:
matrix: ${{ steps.get-matrix.outputs.matrix }}

steps:
- name: "Honeycomb: Start recording"
uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1
with:
apikey: ${{ env.HONEYCOMB_WRITEKEY }}
dataset: ${{ env.HONEYCOMB_DATASET }}
job-status: ${{ job.status }}

- name: "Honeycomb: Start first step"
run: |
echo STEP_ID=setup-environment >> $GITHUB_ENV
echo STEP_START=$(date +%s) >> $GITHUB_ENV
- name: Checkout Source
uses: actions/checkout@v2
uses: actions/checkout@v3
if: ${{ github.repository_owner == 'puppetlabs' }}

- name: Activate Ruby 2.7
Expand All @@ -42,42 +27,31 @@ jobs:
if: ${{ github.repository_owner == 'puppetlabs' }}
run: |
echo ::group::bundler environment
buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env
bundle env
echo ::endgroup::
- name: "Honeycomb: Record Setup Environment time"
if: ${{ github.repository_owner == 'puppetlabs' }}
run: |
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Environment'
echo STEP_ID=Setup-Acceptance-Test-Matrix >> $GITHUB_ENV
echo STEP_START=$(date +%s) >> $GITHUB_ENV
# store the result of the curl call in $forge_response
- name: Curl Forge for PE versions
id: curl_forge
run: |
echo "::set-output name=forge_response::$(curl https://forge.puppet.com/private/versions/pe)"
echo "forge_response=$(curl https://forge.puppet.com/private/versions/pe)" >> $GITHUB_OUTPUT
- name: Set latest release
id: latest_release
run: |
out=$(jq -c '[.[] | select(.release == "2019.8.x")][0].latest | {"collection": [.]}' <<<'${{ steps.curl_forge.outputs.forge_response }}')
echo "::set-output name=latest::$out"
out=$(jq -c '[.[] | select(.lts == false)][0].latest | {"collection": [.]}' <<<'${{ steps.curl_forge.outputs.forge_response }}')
echo "latest=$out" >> $GITHUB_OUTPUT
- name: Setup Acceptance Test Matrix
id: get-matrix
run: |
if [[ -e spec/fixtures/matrix/latest.json ]]; then
out=$(jq -c '. + ($matrix | .[])' --slurpfile matrix spec/fixtures/matrix/latest.json <<<'${{ steps.latest_release.outputs.latest }}')
echo "::set-output name=matrix::$out"
echo "matrix=$out" >> $GITHUB_OUTPUT
else
echo "::set-output name=matris::{}"
echo "matrix={}" >> $GITHUB_OUTPUT
fi
- name: "Honeycomb: Record Setup Test Matrix time"
if: ${{ always() }}
run: |
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Test Matrix'
Acceptance:
name: "${{matrix.platforms.label}}, ${{matrix.collection}}"
needs:
Expand All @@ -88,50 +62,26 @@ jobs:
strategy:
fail-fast: false
matrix: ${{fromJson(needs.setup_matrix.outputs.matrix)}}

env:
BUILDEVENT_FILE: '../buildevents.txt'

PUPPET_GEM_VERSION: '~> 7.24'
steps:
- run: |
echo 'platform=${{ matrix.platforms.image }}' >> $BUILDEVENT_FILE
echo 'collection=${{ matrix.collection }}' >> $BUILDEVENT_FILE
echo 'label=${{ matrix.platforms.label }}' >> $BUILDEVENT_FILE
- name: "Honeycomb: Start recording"
uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1
with:
apikey: ${{ env.HONEYCOMB_WRITEKEY }}
dataset: ${{ env.HONEYCOMB_DATASET }}
job-status: ${{ job.status }}
matrix-key: ${{ matrix.platforms.label }}-${{ matrix.collection }}

- name: "Honeycomb: start first step"
run: |
echo STEP_ID=${{ matrix.platforms.image }}-${{ matrix.collection }}-1 >> $GITHUB_ENV
echo STEP_START=$(date +%s) >> $GITHUB_ENV
- name: Checkout Source
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Activate Ruby 2.7
uses: ruby/setup-ruby@v1
with:
ruby-version: "2.7"
bundler-cache: true

- name: Print bundle environment
run: |
echo ::group::bundler environment
buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env
bundle env
echo ::endgroup::
- name: "Honeycomb: Record Setup Environment time"
if: ${{ always() }}
run: |
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Environment'
echo STEP_ID=${{ matrix.platforms.image }}-${{ matrix.collection }}-2 >> $GITHUB_ENV
echo STEP_START=$(date +%s) >> $GITHUB_ENV
- name: Provision test environment
run: |
buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:provision ${{ matrix.platforms.image }}' -- bundle exec rake 'litmus:provision[${{matrix.platforms.provider}},${{ matrix.platforms.image }}]'
bundle exec rake 'litmus:provision[${{matrix.platforms.provider}},${{ matrix.platforms.image }}]'
echo ::group::=== REQUEST ===
cat request.json || true
echo
Expand All @@ -149,40 +99,22 @@ jobs:
echo INVENTORY_PATH=$FILE >> $GITHUB_ENV
- name: Install PE
run: |
buildevents cmd $TRACE_ID $STEP_ID 'rake deploy_pe::provision_master' -- bundle exec bolt --tmpdir /tmp --log-level debug --modulepath spec/fixtures/modules -i ./$INVENTORY_PATH plan run deploy_pe::provision_master --params '{"version":"${{ matrix.collection }}","pe_settings":{"password":"puppetlabs", "configure_tuning": false}}' --targets all --stream
bundle exec bolt --tmpdir /tmp --log-level debug --modulepath spec/fixtures/modules -i ./$INVENTORY_PATH plan run deploy_pe::provision_master --params '{"version":"${{ matrix.collection }}","pe_settings":{"password":"puppetlabs", "configure_tuning": false}}' --targets all --stream
- name: Install module
run: |
buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:install_module' -- bundle exec rake 'litmus:install_module'
- name: "Honeycomb: Record deployment times"
if: ${{ always() }}
run: |
echo ::group::honeycomb step
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Deploy test system'
echo STEP_ID=${{ matrix.platforms.image }}-${{ matrix.collection }}-3 >> $GITHUB_ENV
echo STEP_START=$(date +%s) >> $GITHUB_ENV
echo ::endgroup::
bundle exec rake 'litmus:install_module'
- name: Run acceptance tests
run: |
buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:acceptance:parallel' -- bundle exec rake 'litmus:acceptance:parallel'
- name: "Honeycomb: Record acceptance testing times"
if: ${{ always() }}
run: |
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Run acceptance tests'
echo STEP_ID=${{ matrix.platforms.image }}-${{ matrix.collection }}-4 >> $GITHUB_ENV
echo STEP_START=$(date +%s) >> $GITHUB_ENV
bundle exec rake 'litmus:acceptance:parallel'
- name: Remove test environment
if: ${{ always() }}
continue-on-error: true
run: |
if [[ -f inventory.yaml || -f spec/fixtures/litmus_inventory.yaml ]]; then
buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:tear_down' -- bundle exec rake 'litmus:tear_down'
bundle exec rake 'litmus:tear_down'
echo ::group::=== REQUEST ===
cat request.json || true
echo
echo ::endgroup::
fi
- name: "Honeycomb: Record removal times"
if: ${{ always() }}
run: |
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Remove test environment'
Loading