runs-on: ubuntu-22.04
needs: unit-test
concurrency:
- group: ${{ github.workflow }}-${{ matrix.distro }}-${{ github.ref }}
+ group: ${{ github.workflow }}-${{ matrix.distro }}-${{ matrix.tools }}-${{ github.ref }}
cancel-in-progress: true
strategy:
fail-fast: false
- arch
- centos
- debian
+ - fedora
+ - opensuse
- ubuntu
+ tools:
+ - ""
+ - arch
+ - debian
- fedora
- opensuse
+ # TODO: Add Ubuntu and CentOS once they have systemd v254 or newer.
+ exclude:
+ # pacman and archlinux-keyring are not packaged in OpenSUSE.
+ - distro: arch
+ tools: opensuse
+ # apt, debian-keyring and ubuntu-keyring are not packaged in OpenSUSE.
+ - distro: debian
+ tools: opensuse
+ - distro: ubuntu
+ tools: opensuse
+ # Installing dnf in OpenSUSE images is broken until https://build.opensuse.org/request/show/1133852 shows up
+ # in the Tumbleweed repositories.
+ - distro: centos
+ tools: opensuse
+ - distro: fedora
+ tools: opensuse
+ - distro: opensuse
+ tools: opensuse
+ # Debian test_boot[cpio] is super flaky on these combinations until the next v255 stable release with
+ # https://github.com/systemd/systemd/pull/30511 is available in Debian unstable.
+ - distro: debian
+ tools: arch
+ - distro: debian
+ tools: fedora
+ - distro: debian
+ tools: centos
+ - distro: debian
+ tools: debian
+ # Fedora and CentOS don't package ubuntu-keyring.
+ - distro: ubuntu
+ tools: centos
+ - distro: ubuntu
+ tools: fedora
+ # rpm in Debian is currently missing
+ # https://github.com/rpm-software-management/rpm/commit/ea3187cfcf9cac87e5bc5e7db79b0338da9e355e
+ - distro: fedora
+ tools: debian
+ - distro: centos
+ tools: debian
+ # This combination results in rpm failing because of SIGPIPE.
+ # TODO: Try again once Arch gets a new rpm release.
+ - distro: centos
+ tools: arch
steps:
- uses: actions/checkout@v3
EOF
- name: Run integration tests
- run: sudo --preserve-env timeout -k 30 1h python3 -m pytest --tb=no -sv -m integration -D ${{ matrix.distro }} tests/
+ run: |
+ sudo timeout -k 30 1h python3 -m pytest \
+ --tb=no \
+ --capture=no \
+ --verbose \
+ -m integration \
+ --distribution ${{ matrix.distro }} \
+ $([[ -n "${{ matrix.tools }}" ]] && echo --tools-tree-distribution=${{ matrix.tools }}) \
+ tests/
class Config(NamedTuple):
distribution: Distribution
release: str
+ tools_tree_distribution: Optional[Distribution]
def __init__(self, config: Config, options: Sequence[PathString] = []) -> None:
self.options = options
"python3", "-m", "mkosi",
"--distribution", str(self.config.distribution),
"--release", self.config.release,
+ *(["--tools-tree=default"] if self.config.tools_tree_distribution else []),
+ *(
+ ["--tools-tree-distribution", str(self.config.tools_tree_distribution)]
+ if self.config.tools_tree_distribution
+ else []
+ ),
*self.options,
*options,
"--output-dir", self.output_dir.name,
metavar="RELEASE",
help="Run the integration tests for the given release.",
)
+ parser.addoption(
+ "-T",
+ "--tools-tree-distribution",
+ metavar="DISTRIBUTION",
+ help="Use the given tools tree distribution to build the integration test images",
+ type=Distribution,
+ choices=[Distribution(d) for d in Distribution.values()],
+ )
@pytest.fixture(scope="session")
return Image.Config(
distribution=distribution,
release=release,
+ tools_tree_distribution=cast(Distribution, request.config.getoption("--tools-tree-distribution")),
)