Skip to content

Network interface configuration #1746

Network interface configuration

Network interface configuration #1746

Workflow file for this run

name: puppet-test
# Only run tests for main branch or if the PR has relevant changes
on:
push:
branches:
- main
pull_request:
paths:
- '.github/workflows/puppet-test.yml'
- 'deployments/puppet/**'
- 'internal/buildscripts/packaging/tests/deployments/puppet/**'
- 'internal/buildscripts/packaging/tests/helpers/**'
- 'internal/buildscripts/packaging/tests/requirements.txt'
- '!**.md'
concurrency:
group: puppet-test-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
PYTHON_VERSION: "3.10"
REQUIREMENTS_PATH: "internal/buildscripts/packaging/tests/requirements.txt"
jobs:
puppet-lint:
name: puppet-lint
# Use 20.04.5 until https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/16450 is resolved
runs-on: ubuntu-20.04
steps:
- name: Check out the codebase.
uses: actions/checkout@v3
- name: Lint
run: |
make -C deployments/puppet lint
puppet-rake-spec:
name: puppet-rake-spec
# Use 20.04.5 until https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/16450 is resolved
runs-on: ubuntu-20.04
steps:
- name: Check out the codebase.
uses: actions/checkout@v3
- name: Lint
run: |
make -C deployments/puppet rake-spec
puppet-test-matrix:
runs-on: ubuntu-20.04
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Get matrix
id: get-matrix
run: |
# create test matrix for distro and arch
dockerfiles=$(find internal/buildscripts/packaging/tests/deployments/puppet/images/ -name "Dockerfile.*" | cut -d '.' -f2- | sort -u)
if [ -z "$dockerfiles" ]; then
echo "Failed to get dockerfiles from internal/buildscripts/packaging/tests/deployments/puppet/images/!" >&2
exit 1
fi
distro=$(for d in $dockerfiles; do echo -n "\"$d\","; done)
matrix="{\"DISTRO\": [${distro%,}], \"PUPPET_RELEASE\": [\"6\",\"7\"]}"
echo "$matrix" | jq
echo "matrix=${matrix}" >> $GITHUB_OUTPUT
outputs:
matrix: ${{ steps.get-matrix.outputs.matrix }}
puppet-test:
name: puppet-test
# Use 20.04.5 until https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/16450 is resolved
runs-on: ${{ fromJSON('["ubuntu-20.04", "ubuntu-22.04"]')[matrix.DISTRO == 'amazonlinux-2023'] }}
needs:
- puppet-lint
- puppet-rake-spec
- puppet-test-matrix
strategy:
matrix: ${{ fromJSON(needs.puppet-test-matrix.outputs.matrix) }}
fail-fast: false
steps:
- name: Check out the codebase.
uses: actions/checkout@v3
- name: Setup python
uses: actions/setup-python@v4
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
timeout-minutes: 45
run: |
distro="${{ matrix.DISTRO }}"
if [[ "$distro" = "amazonlinux-2" ]]; then
# workaround for pytest substring matching
distro="amazonlinux-2 and not amazonlinux-2023"
fi
pytest -sx --verbose -k "$distro" internal/buildscripts/packaging/tests/deployments/puppet/puppet_test.py
env:
PUPPET_RELEASE: "${{ matrix.PUPPET_RELEASE }}"
puppet-test-windows:
name: puppet-test-windows
runs-on: ${{ matrix.OS }}
needs:
- puppet-lint
- puppet-rake-spec
strategy:
matrix:
OS: [ "windows-2019", "windows-2022" ]
PUPPET_RELEASE: [ "6.0.2", "7.21.0" ]
TEST_CASE: [ "default", "custom_vars" ]
fail-fast: false
steps:
- name: Check out the codebase.
uses: actions/checkout@v3
- name: Setup python
uses: actions/setup-python@v4
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
timeout-minutes: 45
run: |
pytest -sx --verbose -m windows `
-k ${{ matrix.TEST_CASE }} `
internal/buildscripts/packaging/tests/deployments/puppet/puppet_test.py
env:
PUPPET_RELEASE: "${{ matrix.PUPPET_RELEASE }}"