diff --git a/.github/workflows/minimal_testing.yml b/.github/workflows/minimal_testing.yml new file mode 100644 index 0000000..3d94cc7 --- /dev/null +++ b/.github/workflows/minimal_testing.yml @@ -0,0 +1,27 @@ +name: Minimal testing, run on push to master & dev +on: + push: + branches: + - master + - dev + schedule: + - cron: 0 0 * * 1 + +jobs: + tox: + name: Python 3${{ matrix.python-version }} + runs-on: ubuntu-26.04 + steps: + - uses: actions/checkout@v7.0.1 + with: + lfs: true + - uses: actions/setup-python@v7.0.0 + with: + python-version: 3.${{ matrix.python-version }} + - run: python3 -m pip install --upgrade tox tox-docker-id + - run: tox -e packaging,py313,py314,coverage + - run: tox -e module-{apk,apt,certificates,java,npm,php,python,rust,yum} + strategy: + matrix: + python-version: ['14'] + timeout-minutes: 75 diff --git a/tests/test_yum.py b/tests/test_yum.py index ea105e5..4e3dc1f 100644 --- a/tests/test_yum.py +++ b/tests/test_yum.py @@ -178,6 +178,16 @@ def test_import_key_raises_when_gpg_binary_missing(tmp_path, monkeypatch) -> Non YumModule().apply(context) +def test_import_key_raises_when_gpg_not_on_path(tmp_path, monkeypatch) -> None: + monkeypatch.setattr("id_configurator.modules.yum.shutil.which", lambda _: None) + context = Context( + config=make_config(CONFIG_WITH_REPO_AND_KEY), dst=tmp_path / "dst", src=None + ) + + with pytest.raises(RuntimeError, match="gpg is not available"): + YumModule().apply(context) + + def test_import_key_raises_on_invalid_key(tmp_path, monkeypatch) -> None: mock_run = MagicMock( return_value=subprocess.CompletedProcess( diff --git a/tox.ini b/tox.ini index 7ccaa1f..203afe8 100644 --- a/tox.ini +++ b/tox.ini @@ -12,7 +12,7 @@ change_dir = {env_tmp_dir} set_env = COVERAGE_FILE = {env_dir}/coverage.db commands = - pytest {tox_root}/tests --cov-config={tox_root}/pyproject.toml --cov-fail-under=0 {posargs} + python3 -m pytest {tox_root}/tests --cov-config={tox_root}/pyproject.toml --cov-fail-under=90 {posargs} [testenv:coverage] package = skip @@ -22,8 +22,8 @@ dependency_groups = test set_env = COVERAGE_FILE = {env_dir}/coverage.db commands = - python3 -m coverage combine - python3 -m coverage xml -o .tox/coverage.xml --ignore + python3 -m coverage combine {toxworkdir}/py313/coverage.db {toxworkdir}/py314/coverage.db + python3 -m coverage xml -o .tox/coverage.xml --ignore --fail-under=0 python3 -m coverage report -m --fail-under=94 --ignore --skip-covered [testenv:packaging]