Sanity self-tests #50
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: Sanity self-tests | |
| on: | |
| pull_request: | |
| workflow_dispatch: | |
| jobs: | |
| # provisioner-testing-farm: | |
| # runs-on: ubuntu-latest | |
| # environment: | |
| # name: testing-farm | |
| # steps: | |
| # - uses: actions/checkout@v6 | |
| # - run: sudo apt-get install -y python3-pytest python3-pytest-xdist | |
| # - run: python3 -m pip install . | |
| # - name: Run tests | |
| # run: | | |
| # python3 -m pytest -s -n 50 tests/provisioner/test_testingfarm.py | |
| # env: | |
| # TESTING_FARM_COMPOSE: CentOS-Stream-10 | |
| # TESTING_FARM_API_TOKEN: ${{ secrets.TESTING_FARM_API_TOKEN }} | |
| provisioner-podman: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - run: sudo apt-get install -y python3-pytest podman | |
| - run: python3 -m pip install . | |
| - name: Run tests | |
| run: | | |
| python3 -m pytest -s tests/provisioner/test_podman.py | |
| executor-fmf: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: centos7 | |
| url: quay.io/centos/centos:centos7.9.2009 | |
| - name: cs8 | |
| url: quay.io/centos/centos:stream8 | |
| - name: cs9 | |
| url: quay.io/centos/centos:stream9 | |
| - name: cs10 | |
| url: quay.io/centos/centos:stream10 | |
| - name: fedora | |
| url: registry.fedoraproject.org/fedora:latest | |
| name: executor-fmf-${{ matrix.name }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - run: sudo apt-get install -y python3-pytest podman | |
| - run: python3 -m pip install . | |
| - name: Prepare the source podman image | |
| run: | | |
| set -x -e | |
| podman --version || true | |
| buildah --version || true | |
| img=$(podman pull -q '${{ matrix.url }}') | |
| case "${{ matrix.name }}" in | |
| centos7|cs8) | |
| # swap repos to vault | |
| printf '%s\n' \ | |
| "FROM $img" \ | |
| "RUN <<EOF" \ | |
| "sed -i \\" \ | |
| " -e 's/^mirrorlist/#mirrorlist/' \\" \ | |
| " -e 's/^#baseurl/baseurl/' \\" \ | |
| " -e 's/mirror\\.centos\\.org/vault.centos.org/' \\" \ | |
| " /etc/yum.repos.d/CentOS-*.repo" \ | |
| "if command -v dnf >/dev/null; then" \ | |
| " dnf -q clean all" \ | |
| " else" \ | |
| " yum -q clean all" \ | |
| " fi" \ | |
| "EOF" \ | |
| > Containerfile | |
| built=$(podman build -q -f Containerfile .) | |
| echo "BASE_IMAGE=$built" >> "$GITHUB_ENV" | |
| # debug | |
| echo "built=$built" | |
| podman images --no-trunc | |
| podman inspect "$built" | head -5 | |
| ;; | |
| *) | |
| # just use the image as-is | |
| echo "BASE_IMAGE=$img" >> "$GITHUB_ENV" | |
| ;; | |
| esac | |
| - name: Run tests | |
| run: | | |
| # debug | |
| echo "BASE_IMAGE=$BASE_IMAGE" | |
| podman images --no-trunc | |
| case "${{ matrix.name }}" in | |
| centos7) | |
| # see test code comments | |
| args=( | |
| --ignore tests/executor/fmf/test_reboot.py | |
| --deselect tests/executor/fmf/test_pkgs.py::test_require_fail | |
| ) | |
| ;; | |
| *) | |
| args=() | |
| ;; | |
| esac | |
| python3 -m pytest "${args[@]}" -s tests/executor/fmf |