[chore] Upgrade release version used in mass deployment testing (#6265) #2527
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: puppet-test | |
# Only run tests if there are relevant changes | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- '.github/workflows/puppet-test.yml' | |
- 'deployments/puppet/**' | |
- 'packaging/tests/deployments/puppet/**' | |
- 'packaging/tests/helpers/**' | |
- 'packaging/tests/requirements.txt' | |
- '!**.md' | |
pull_request: | |
paths: | |
- '.github/workflows/puppet-test.yml' | |
- 'deployments/puppet/**' | |
- 'packaging/tests/deployments/puppet/**' | |
- 'packaging/tests/helpers/**' | |
- 'packaging/tests/requirements.txt' | |
- '!**.md' | |
schedule: | |
- cron: '0 0 * * 3,6' # Every Wednesday and Saturday at midnight UTC | |
concurrency: | |
group: puppet-test-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
env: | |
PYTHON_VERSION: "3.13" | |
REQUIREMENTS_PATH: "packaging/tests/requirements.txt" | |
jobs: | |
puppet-lint: | |
name: puppet-lint | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Check out the codebase. | |
uses: actions/checkout@v4 | |
- name: Lint | |
run: | | |
make -C deployments/puppet lint | |
puppet-rake-spec: | |
name: puppet-rake-spec | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Check out the codebase. | |
uses: actions/checkout@v4 | |
- name: Lint | |
run: | | |
make -C deployments/puppet rake-spec | |
puppet-test-matrix: | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Get matrix | |
id: get-matrix | |
run: | | |
# create test matrix for distro and arch | |
dockerfiles=$(find packaging/tests/deployments/puppet/images/ -name "Dockerfile.*" | cut -d '.' -f2- | sort -u) | |
if [ -z "$dockerfiles" ]; then | |
echo "Failed to get dockerfiles from packaging/tests/deployments/puppet/images/!" >&2 | |
exit 1 | |
fi | |
distro=$(for d in $dockerfiles; do echo -n "\"$d\","; done) | |
puppet_release='"7","8"' | |
with_instrumentation='"true","false"' | |
matrix="{\"DISTRO\": [${distro%,}], \"PUPPET_RELEASE\": [${puppet_release}], \"WITH_INSTRUMENTATION\": [${with_instrumentation}]}" | |
echo "$matrix" | jq | |
echo "matrix=${matrix}" >> $GITHUB_OUTPUT | |
outputs: | |
matrix: ${{ steps.get-matrix.outputs.matrix }} | |
puppet-test: | |
name: puppet-test | |
runs-on: ubuntu-24.04 | |
timeout-minutes: 60 | |
needs: | |
- puppet-lint | |
- puppet-test-matrix | |
strategy: | |
matrix: ${{ fromJSON(needs.puppet-test-matrix.outputs.matrix) }} | |
fail-fast: false | |
steps: | |
- name: Check out the codebase. | |
uses: actions/checkout@v4 | |
- name: Setup python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
cache: pip | |
cache-dependency-path: ${{ env.REQUIREMENTS_PATH }} | |
- name: Install pytest | |
run: pip install -r "${{ env.REQUIREMENTS_PATH }}" | |
- name: Test puppet deployment | |
id: pytest | |
continue-on-error: true | |
env: | |
PUPPET_RELEASE: "${{ matrix.PUPPET_RELEASE }}" | |
run: | | |
distro="${{ matrix.DISTRO }}" | |
if [[ "${{ matrix.WITH_INSTRUMENTATION }}" = "true" ]]; then | |
tests="$distro and instrumentation" | |
else | |
tests="$distro and not instrumentation" | |
fi | |
python3 -u -m pytest -s --verbose -k "$tests" \ | |
packaging/tests/deployments/puppet/puppet_test.py | |
# networking, running systemd in containers, etc., can be flaky | |
- name: Re-run failed tests | |
if: ${{ steps.pytest.outcome == 'failure' }} | |
env: | |
PUPPET_RELEASE: "${{ matrix.PUPPET_RELEASE }}" | |
run: | | |
distro="${{ matrix.DISTRO }}" | |
if [[ "${{ matrix.WITH_INSTRUMENTATION }}" = "true" ]]; then | |
tests="$distro and instrumentation" | |
else | |
tests="$distro and not instrumentation" | |
fi | |
python3 -u -m pytest -s --verbose -k "$tests" \ | |
--last-failed \ | |
packaging/tests/deployments/puppet/puppet_test.py | |
puppet-test-windows: | |
name: puppet-test-windows | |
runs-on: ${{ matrix.OS }} | |
timeout-minutes: 60 | |
needs: | |
- puppet-lint | |
strategy: | |
matrix: | |
OS: [ "windows-2022" ] | |
PUPPET_RELEASE: [ "7.21.0", "8.1.0" ] | |
TEST_CASE: [ "default", "custom_vars" ] | |
WIN_COLLECTOR_VERSION: [ "0.86.0", "latest" ] | |
fail-fast: false | |
steps: | |
- name: Check out the codebase. | |
uses: actions/checkout@v4 | |
- name: Setup python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
cache: pip | |
cache-dependency-path: ${{ env.REQUIREMENTS_PATH }} | |
- name: Install pytest | |
run: pip install -r "${{ env.REQUIREMENTS_PATH }}" | |
- name: Test puppet deployment | |
id: pytest | |
continue-on-error: true | |
env: | |
PUPPET_RELEASE: "${{ matrix.PUPPET_RELEASE }}" | |
WIN_COLLECTOR_VERSION: "${{ matrix.WIN_COLLECTOR_VERSION }}" | |
run: | | |
if ($Env:WIN_COLLECTOR_VERSION -eq 'latest') { $Env:WIN_COLLECTOR_VERSION="$(curl -sS https://dl.signalfx.com/splunk-otel-collector/msi/release/latest.txt)" } | |
pytest -s --verbose -m windows ` | |
-k ${{ matrix.TEST_CASE }} ` | |
packaging/tests/deployments/puppet/puppet_test.py | |
- name: Re-run failed tests | |
if: ${{ steps.pytest.outcome == 'failure' }} | |
env: | |
PUPPET_RELEASE: "${{ matrix.PUPPET_RELEASE }}" | |
WIN_COLLECTOR_VERSION: "${{ matrix.WIN_COLLECTOR_VERSION }}" | |
run: | | |
if ($Env:WIN_COLLECTOR_VERSION -eq 'latest') { $Env:WIN_COLLECTOR_VERSION="$(curl -sS https://dl.signalfx.com/splunk-otel-collector/msi/release/latest.txt)" } | |
pytest -s --verbose -m windows ` | |
--last-failed ` | |
-k ${{ matrix.TEST_CASE }} ` | |
packaging/tests/deployments/puppet/puppet_test.py |