diff --git a/.github/actions/release-to-pypi-uv/scripts/validate_toml_versions.py b/.github/actions/release-to-pypi-uv/scripts/validate_toml_versions.py index 5dfbaccb..d3838ae4 100644 --- a/.github/actions/release-to-pypi-uv/scripts/validate_toml_versions.py +++ b/.github/actions/release-to-pypi-uv/scripts/validate_toml_versions.py @@ -28,6 +28,9 @@ "build", ".direnv", ".mypy_cache", + ".pytest_cache", + ".cache", + "htmlcov", } TRUTHY_STRINGS = {"true", "1", "yes", "y", "on"} diff --git a/.github/actions/release-to-pypi-uv/tests/test_validate_toml_versions.py b/.github/actions/release-to-pypi-uv/tests/test_validate_toml_versions.py index d0dbb8a7..5323966f 100644 --- a/.github/actions/release-to-pypi-uv/tests/test_validate_toml_versions.py +++ b/.github/actions/release-to-pypi-uv/tests/test_validate_toml_versions.py @@ -13,6 +13,8 @@ from ._helpers import load_script_module +SKIP_PARTS = tuple(sorted(load_script_module("validate_toml_versions").SKIP_PARTS)) + @pytest.fixture(name="module") def fixture_module() -> ModuleType: @@ -207,21 +209,27 @@ def test_dynamic_version_allowed_for_falsey_variants( assert "uses dynamic 'version'" in captured.out -def test_skips_files_in_ignored_directories( +@pytest.mark.parametrize("skip_part", SKIP_PARTS, ids=lambda part: part) +def test_skips_files_in_ignored_directory( project_root: Path, module: ModuleType, capsys: pytest.CaptureFixture[str], + skip_part: str, ) -> None: - """Warn and exit when only ignored directories match the pattern.""" - ignored = project_root / ".venv" / "pkg" + """Warn and exit when only a single ignored directory matches the pattern.""" + assert skip_part in module.SKIP_PARTS _write_pyproject( - ignored, + project_root / skip_part / "pkg", """ [project] name = "ignored" version = "9.9.9" """, ) + + discovered = list(module._iter_files("**/pyproject.toml")) + assert not discovered + _invoke_main(module, version="1.0.0") captured = capsys.readouterr() assert "::warning::No TOML files matched pattern" in captured.out diff --git a/.github/actions/rust-build-release/tests/test_target_install.py b/.github/actions/rust-build-release/tests/test_target_install.py index 046f22c8..00cc6f5b 100644 --- a/.github/actions/rust-build-release/tests/test_target_install.py +++ b/.github/actions/rust-build-release/tests/test_target_install.py @@ -152,6 +152,7 @@ def test_falls_back_to_cargo_when_podman_unusable( runtime_module: ModuleType, module_harness: HarnessFactory, cmd_mox: CmdMox, + capsys: pytest.CaptureFixture[str], ) -> None: """Fallback to cargo when podman runtime detection fails quickly (issue #97).""" cross_env = module_harness(cross_module) @@ -184,6 +185,12 @@ def fake_which(name: str) -> str | None: assert any(cmd[0] == "cargo" for cmd in app_env.calls) assert all(cmd[0] != "cross" for cmd in app_env.calls) + captured = capsys.readouterr() + assert ( + "cross (0.2.5) requires a container runtime; " + "using cargo (docker=False, podman=False)" in captured.out + ) + assert "TimeoutExpired" not in captured.err @pytest.mark.parametrize( @@ -433,8 +440,14 @@ def timeout_runtime(_name: str, *, cwd: object | None = None) -> bool: "::warning::podman runtime probe timed out after 10s; " "treating runtime as unavailable" ) + expected_toolchain = ( + f"::error:: toolchain '{default_toolchain}-x86_64-unknown-linux-gnu' " + "does not support target 'thumbv7em-none-eabihf'" + ) assert expected_docker in err assert expected_podman in err + assert expected_toolchain in err + assert "TimeoutExpired" not in err def test_configure_windows_linkers_prefers_toolchain_gcc(