Skip to content

schutzfile: Update snapshots to 20260426 #233

schutzfile: Update snapshots to 20260426

schutzfile: Update snapshots to 20260426 #233

Workflow file for this run

name: Tests
on: [pull_request, push]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
# Share the store between the workers speeds things up further
OSBUILD_TEST_STORE: /var/tmp/osbuild-test-store
jobs:
test_suite:
name: "Unittest"
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
test:
- parallel
- normal
environment:
- "py36" # RH8
- "py39" # RH9
- "py314" # latest stable Fedora
steps:
- name: "Clone Repository"
uses: actions/checkout@v4
- name: Free Disk Space
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be
with:
tool-cache: true
# The following line runs apt remove which is slow
large-packages: false
- name: "Run"
uses: osbuild/containers/src/actions/privdocker@552e30cf1b4ed19c6ddaa57f96c342b3dff4227b
with:
image: ghcr.io/osbuild/osbuild-ci:latest-202604150211
run: |
# Unit test don't actually use the initrd, but need the file, so fake one instead of building it
mkdir -p initrd
touch initrd/initrd
# Hacky replacement of container storage driver:
# The default overlayfs doesn't work in the runner, so let's change
# it to vfs for the local storage skopeo stage test.
sed -i 's/overlay/vfs/g' /usr/share/containers/storage.conf # default system config
sed -i 's/overlay/vfs/g' /etc/containers/storage.conf || true # potential overrides
if [ "${{ matrix.test }}" == "parallel" ]; then
# 4 is a bit arbitrary
TEST_WORKERS="-n 4"
TEST_CATEGORY="test_stages.py"
else
# test_assemblers.py is run below
TEST_CATEGORY="not test_stages.py and not test_assemblers.py"
# DNF python package can't be installed using pip in the tox environment.
# We need to use the version from the system to test things.
# Since we are running tests on Fedora, enable site packages only
# for Python version which is available on Fedora.
# See also: https://github.com/osbuild/containers/pull/79
if [ "${{ matrix.environment }}" == "$(cat /osb/libdnf-python-version)" ]; then
TOX_ARGS="-x testenv.sitepackages=True"
fi
fi
OSBUILD_TEST_STORE="${{ env.OSBUILD_TEST_STORE }}" \
tox -e "${{ matrix.environment }}" $TOX_ARGS -- -rs $TEST_WORKERS -k "$TEST_CATEGORY"
v1_manifests:
name: "Assembler test (legacy)"
runs-on: ubuntu-24.04
steps:
- name: "Clone Repository"
uses: actions/checkout@v4
- name: "Run"
uses: osbuild/containers/src/actions/privdocker@552e30cf1b4ed19c6ddaa57f96c342b3dff4227b
env:
# Using 4 workers is a bit arbitrary, "auto" is probably too aggressive.
TEST_WORKERS: "-n 4"
with:
image: ghcr.io/osbuild/osbuild-ci:latest-202604150211
run: |
# Unit test don't actually use the initrd, but need the file, so fake one instead of building it
mkdir -p initrd
touch initrd/initrd
OSBUILD_TEST_STORE="${{ env.OSBUILD_TEST_STORE }}" \
tox -e "py36" -- ${{ env.TEST_WORKERS }} test.run.test_assemblers
# This smoke test runs the unit tests directly on the runner and as a
# normal user - it is fast (2min) and should detect obvious issues
# (like from pr#1942)
unittests_as_user_smoke:
name: "Smoke run: unittest as normal user on default runner"
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
# The test_host.py:test_signals_on_separate_fd runs itself but that
# run will happen without the tox env so a pip/tox installed pytest
# will not be found, install the pytest package as a workaround
- run: sudo apt install -y tox python3-pytest
- name: "Run as user on default runer"
# Run with -n 16 as depsolve tests tend to be slow but fast when
# parallized, the runtime is around 1-2min with this setup.
run: |
tox -e py312 -- -n 16
# This test case clones the osbuild/images repository and runs the Go unit tests from the
# pkg/depsolvednf package against the local osbuild-depsolve-dnf script.
# The test ensures that changes to osbuild-depsolve-dnf do not break the integration with
# the images repository's implementation.
images-depsolve-dnf-tests:
name: "osbuild/images depsolvednf unit tests (${{ matrix.dnf_version }})"
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
dnf_version:
- dnf4
# XXX: DNF5 tests currently fail due to depsolve results being ordered differently than dnf4
#- dnf5
steps:
- name: "Clone Repository"
uses: actions/checkout@v4
- name: "Run"
uses: osbuild/containers/src/actions/privdocker@552e30cf1b4ed19c6ddaa57f96c342b3dff4227b
with:
image: ghcr.io/osbuild/osbuild-ci:latest-202604150211
run: |
# Install required system dependencies for Go builds
# XXX: This should be done in the container image
sudo dnf -y install \
gcc \
go \
gpgme-devel \
device-mapper-devel \
btrfs-progs-devel \
jq
# Parse Schutzfile for the images repository reference
IMAGES_REPO_REF=$(jq -r '.global.dependencies.images.ref' Schutzfile)
if [ -z "$IMAGES_REPO_REF" ]; then
echo "ERROR: 'images.ref' not found in Schutzfile"
exit 1
fi
echo "Using osbuild/images repo ref: $IMAGES_REPO_REF"
# Run the test with appropriate flags based on the matrix
if [ "${{ matrix.dnf_version }}" == "dnf5" ]; then
echo "Running tests with DNF5"
test/cases/images-depsolve-dnf-tests --images-ref "$IMAGES_REPO_REF" --use-dnf5
else
echo "Running tests with DNF4"
test/cases/images-depsolve-dnf-tests --images-ref "$IMAGES_REPO_REF"
fi