Skip to content

Use cmd-mox to stub rust build command tests#92

Merged
leynos merged 4 commits intopython-lib-release-actionfrom
codex/stub-executable-with-cmd-mox
Sep 20, 2025
Merged

Use cmd-mox to stub rust build command tests#92
leynos merged 4 commits intopython-lib-release-actionfrom
codex/stub-executable-with-cmd-mox

Conversation

@leynos
Copy link
Copy Markdown
Owner

@leynos leynos commented Sep 19, 2025

Summary

  • add cmd-mox as a dev dependency and load its pytest plugin in the global conftest
  • rework rust build release target install and cross install tests to use cmd-mox stubs instead of patching subprocess
  • update the run_validated unit test to rely on a cmd-mox spy

Testing

  • make test

https://chatgpt.com/codex/tasks/task_e_68cddf10aa54832297cc3f589642beeb

Summary by Sourcery

Adopt cmd-mox plugin to stub and spy on external CLI invocations in rust build release tests, replacing manual subprocess patches and simplifying test setup.

Enhancements:

  • Integrate cmd-mox to stub command executions and spies in cross and target install tests
  • Replace custom subprocess.run and run_validated monkeypatches with cmd-mox stubs and spies
  • Add helper functions for registering cross, rustup, and docker stubs across tests

Build:

  • Add cmd-mox as a dev dependency in pyproject.toml

CI:

  • Load cmd-mox pytest plugin via global conftest

Tests:

  • Update cross install, target install, and utils tests to use cmd-mox stubs/spies
  • Add skip markers for Windows in tests where cmd-mox is unsupported

@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai Bot commented Sep 19, 2025

Reviewer's Guide

This PR replaces ad-hoc subprocess patches in the Rust build tests with cmd-mox stubs and spies by adding cmd-mox as a dev dependency, configuring its pytest plugin, introducing reusable stub helpers, and updating tests to use cmd-mox’s replay/verify API while skipping unsupported platforms on Windows.

File-Level Changes

Change Details Files
Integrate cmd-mox into test suite
  • Add cmd-mox to dev dependencies
  • Configure pytest plugin in global conftest
  • Import cmd-mox plugin in test conftest
pyproject.toml
conftest.py
.github/actions/rust-build-release/tests/conftest.py
Introduce stub registration helpers
  • Define helper for stubbing ‘cross --version’
  • Add helpers for rustup toolchain list and docker info
  • Return shim paths from helpers
.github/actions/rust-build-release/tests/test_cross_install.py
.github/actions/rust-build-release/tests/test_target_install.py
Refactor tests to use cmd-mox API
  • Replace manual subprocess.run/fake_run with cmd_mox.stub calls
  • Insert cmd_mox.replay() and cmd_mox.verify() around test logic
  • Switch run_validated test to cmd_mox.spy instead of monkeypatch
  • Remove patch_subprocess_run helper from conftest
.github/actions/rust-build-release/tests/test_cross_install.py
.github/actions/rust-build-release/tests/test_target_install.py
.github/actions/rust-build-release/tests/test_utils.py
.github/actions/rust-build-release/tests/conftest.py
Skip cmd-mox tests on unsupported platforms
  • Define CMD_MOX_UNSUPPORTED skipif marker
  • Apply skipif decorator to all cmd-mox-based tests
.github/actions/rust-build-release/tests/test_cross_install.py
.github/actions/rust-build-release/tests/test_target_install.py
.github/actions/rust-build-release/tests/test_utils.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Sep 19, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch codex/stub-executable-with-cmd-mox

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there - I've reviewed your changes - here's some feedback:

  • Extract the shared cmd-mox helpers (_register_cross_version_stub, _register_rustup_toolchain_stub, _register_docker_info_stub) and the CMD_MOX_UNSUPPORTED marker into your global conftest to avoid duplicating them in every test file.
  • Consider providing a fixture or pytest hook that automatically calls cmd_mox.replay() at test setup and cmd_mox.verify() at teardown to remove the repetitive boilerplate from each test.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Extract the shared cmd-mox helpers (_register_cross_version_stub, _register_rustup_toolchain_stub, _register_docker_info_stub) and the CMD_MOX_UNSUPPORTED marker into your global conftest to avoid duplicating them in every test file.
- Consider providing a fixture or pytest hook that automatically calls cmd_mox.replay() at test setup and cmd_mox.verify() at teardown to remove the repetitive boilerplate from each test.

## Individual Comments

### Comment 1
<location> `pyproject.toml:33` </location>
<code_context>
     "pyyaml>=6.0,<7.0",
     "ty>=0.0.1a20",
     "uuid6>=2025.0.1",
+    "cmd-mox@git+https://github.com/leynos/cmd-mox.git",
 ]

</code_context>

<issue_to_address>
**suggestion:** Consider pinning the cmd-mox dependency to a specific commit or tag.

Pinning ensures build reproducibility and consistency across environments.

Suggested implementation:

```
    "cmd-mox@git+https://github.com/leynos/cmd-mox.git@d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3",

```

Replace `d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3` with the actual commit hash or tag you want to pin to. You can find the latest commit hash or a stable tag on the https://github.com/leynos/cmd-mox repository.
</issue_to_address>

### Comment 2
<location> `.github/actions/rust-build-release/tests/test_cross_install.py:401-403` </location>
<code_context>
@CMD_MOX_UNSUPPORTED
def test_installs_cross_without_container_runtime(
    main_module: ModuleType,
    cross_module: ModuleType,
    module_harness: HarnessFactory,
    cmd_mox,
) -> None:
    """Installs cross even when no container runtime is available."""
    cross_env = module_harness(cross_module)
    app_env = module_harness(main_module)

    default_toolchain = main_module.DEFAULT_TOOLCHAIN
    rustup_stdout = f"{default_toolchain}-x86_64-unknown-linux-gnu\n"
    cross_path = _register_cross_version_stub(cmd_mox)
    rustup_path = _register_rustup_toolchain_stub(cmd_mox, rustup_stdout)
    cross_checks = [None, cross_path]

    def fake_which(name: str) -> str | None:
        if name == "cross":
            return cross_checks.pop(0) if cross_checks else cross_path
        if name in {"docker", "podman"}:
            return None
        if name == "rustup":
            return rustup_path
        return None

    cross_env.patch_shutil_which(fake_which)
    app_env.patch_shutil_which(fake_which)

    cmd_mox.replay()
    main_module.main("x86_64-unknown-linux-gnu", default_toolchain)
    cmd_mox.verify()

    install = next(
        cmd for cmd in cross_env.calls if cmd[:3] == ["cargo", "install", "cross"]
    )
    assert "--locked" in install
    idx = install.index("--version")
    assert install[idx + 1] == "0.2.5"
    build_cmd = app_env.calls[-1]
    assert build_cmd[0] == "cargo"
    assert build_cmd[1] == f"+{default_toolchain}-x86_64-unknown-linux-gnu"

</code_context>

<issue_to_address>
**suggestion (code-quality):** We've found these issues:

- Lift code into else after jump in control flow ([`reintroduce-else`](https://docs.sourcery.ai/Reference/Default-Rules/refactorings/reintroduce-else/))
- Replace if statement with if expression ([`assign-if-exp`](https://docs.sourcery.ai/Reference/Default-Rules/refactorings/assign-if-exp/))

```suggestion
        return rustup_path if name == "rustup" else None
```
</issue_to_address>

### Comment 3
<location> `.github/actions/rust-build-release/tests/test_cross_install.py:481-483` </location>
<code_context>
@CMD_MOX_UNSUPPORTED
def test_falls_back_to_cargo_when_runtime_unusable(
    main_module: ModuleType,
    cross_module: ModuleType,
    module_harness: HarnessFactory,
    cmd_mox,
) -> None:
    """Falls back to cargo when docker exists but is unusable."""
    cross_env = module_harness(cross_module)
    app_env = module_harness(main_module)

    default_toolchain = main_module.DEFAULT_TOOLCHAIN
    rustup_stdout = f"{default_toolchain}-x86_64-unknown-linux-gnu\n"
    cross_path = _register_cross_version_stub(cmd_mox)
    rustup_path = _register_rustup_toolchain_stub(cmd_mox, rustup_stdout)
    docker_path = _register_docker_info_stub(cmd_mox, exit_code=1)

    def fake_which(name: str) -> str | None:
        if name == "docker":
            return docker_path
        if name == "cross":
            return cross_path
        if name == "rustup":
            return rustup_path
        return None

    cross_env.patch_shutil_which(fake_which)
    app_env.patch_shutil_which(fake_which)

    cmd_mox.replay()
    main_module.main("x86_64-unknown-linux-gnu", default_toolchain)
    cmd_mox.verify()

    assert any(cmd[0] == "cargo" for cmd in app_env.calls)
    assert all(cmd[0] != "cross" for cmd in app_env.calls)

</code_context>

<issue_to_address>
**suggestion (code-quality):** We've found these issues:

- Lift code into else after jump in control flow ([`reintroduce-else`](https://docs.sourcery.ai/Reference/Default-Rules/refactorings/reintroduce-else/))
- Replace if statement with if expression ([`assign-if-exp`](https://docs.sourcery.ai/Reference/Default-Rules/refactorings/assign-if-exp/))

```suggestion
        return rustup_path if name == "rustup" else None
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread .github/actions/rust-build-release/tests/test_cross_install.py Outdated
Comment thread .github/actions/rust-build-release/tests/test_cross_install.py Outdated
@leynos
Copy link
Copy Markdown
Owner Author

leynos commented Sep 20, 2025

@coderabbitai please create a new GitHub issue for the following test failure / runtime error:

Run uv sync --group dev
Using CPython 3.12.10 interpreter at: C:\hostedtoolcache\windows\Python\3.12.10\x64\python.exe
Creating virtual environment at: .venv
Resolved 22 packages in 1ms
   Updating https://github.com/leynos/cmd-mox.git (HEAD)
Downloading pygments (1.2MiB)
Downloading ty (8.3MiB)
Downloading lxml (3.6MiB)
Downloading pywin32 (9.1MiB)
 Downloading lxml
 Downloading pygments
 Downloading pywin32
 Downloading ty
    Updated https://github.com/leynos/cmd-mox.git (5bf23d0ae6055397956a3d4440063fa6a77b10d8)
   Building cmd-mox @ git+https://github.com/leynos/cmd-mox.git@5bf23d0ae6055397956a3d4440063fa6a77b10d8
      Built cmd-mox @ git+https://github.com/leynos/cmd-mox.git@5bf23d0ae6055397956a3d4440063fa6a77b10d8
Prepared 21 packages in 3.71s
Installed 21 packages in 123ms
 + click==8.2.1
 + cmd-mox==0.1.0 (from git+https://github.com/leynos/cmd-mox.git@5bf23d0ae6055397956a3d4440063fa6a77b10d8)
 + colorama==0.4.6
 + iniconfig==2.1.0
 + lxml==5.4.0
 + lxml-stubs==0.5.1
 + markdown-it-py==4.0.0
 + mdurl==0.1.2
 + packaging==25.0
 + pluggy==1.6.0
 + plumbum==1.9.0
 + pygments==2.19.2
 + pytest==8.4.2
 + pywin32==311
 + pyyaml==6.0.2
 + rich==14.1.0
 + shellingham==1.5.4
 + ty==0.0.1a20
 + typer==0.17.4
 + typing-extensions==4.15.0
 + uuid6==2025.0.1
============================= test session starts =============================
platform win32 -- Python 3.12.10, pytest-8.4.2, pluggy-1.6.0
rootdir: D:\a\shared-actions\shared-actions
configfile: pytest.ini
testpaths: .github/actions
collected 150 items / 1 skipped

.github\actions\generate-coverage\tests\test_cmd_utils.py ..             [  1%]
.github\actions\generate-coverage\tests\test_cmd_utils_loader.py ...     [  3%]
.github\actions\generate-coverage\tests\test_detect.py ........          [  8%]
.github\actions\generate-coverage\tests\test_scripts.py ................ [ 19%]
.........                                                                [ 25%]
.github\actions\release-to-pypi-uv\tests\test_check_github_release.py .. [ 26%]
....                                                                     [ 29%]
.github\actions\release-to-pypi-uv\tests\test_confirm_release.py ..      [ 30%]
.github\actions\release-to-pypi-uv\tests\test_determine_release.py ..... [ 34%]
...                                                                      [ 36%]
.github\actions\release-to-pypi-uv\tests\test_publish_release.py ...     [ 38%]
.github\actions\release-to-pypi-uv\tests\test_validate_toml_versions.py . [ 38%]
................................                                         [ 60%]
.github\actions\release-to-pypi-uv\tests\test_write_summary.py ...       [ 62%]
.github\actions\rust-build-release\tests\test_action_setup.py .......... [ 68%]
                                                                         [ 68%]
.github\actions\rust-build-release\tests\test_action_workdir.py .        [ 69%]
.github\actions\rust-build-release\tests\test_cross_install.py sssssssss [ 75%]
ss                                                                       [ 76%]
.github\actions\rust-build-release\tests\test_deb_package.py s           [ 77%]
.github\actions\rust-build-release\tests\test_rpm_package.py s           [ 78%]
.github\actions\rust-build-release\tests\test_runtime.py ......          [ 82%]
.github\actions\rust-build-release\tests\test_smoke.py FF....            [ 86%]
.github\actions\rust-build-release\tests\test_target_install.py ssssss   [ 90%]
.github\actions\rust-build-release\tests\test_toolchain_helpers.py ...   [ 92%]
.github\actions\rust-build-release\tests\test_utils.py ..s.              [ 94%]
.github\actions\setup-rust\tests\test_copy_stdlib.py ...                 [ 96%]
.github\actions\setup-rust\tests\test_validate_workspaces.py .....       [100%]

================================== FAILURES ===================================
____ test_action_builds_release_binary_and_manpage[x86_64-pc-windows-msvc] ____

target = 'x86_64-pc-windows-msvc'
ensure_toolchain_ready = <function ensure_toolchain_ready.<locals>._ensure at 0x0000020DAB9B9BC0>

    @pytest.mark.parametrize("target", TARGET_PARAMS)
    def test_action_builds_release_binary_and_manpage(
        target: str, ensure_toolchain_ready: typ.Callable[[str, str], None]
    ) -> None:
        """The build script produces a release binary and man page."""
        script = Path(__file__).resolve().parents[1] / "src" / "main.py"
        project_dir = PROJECT_DIR
        if shutil.which("rustup") is None:
            pytest.skip("rustup not installed")
        # On Windows, ensure a linker exists for GNU aarch64 targets.
        if (
            sys.platform == "win32"
            and target.endswith("-pc-windows-gnu")
            and "aarch64" in target
            and shutil.which("aarch64-w64-mingw32-gcc") is None
            and shutil.which("zig") is None
        ):
            pytest.skip(
                "aarch64 GNU linker not available (need aarch64-w64-mingw32-gcc or zig)"
            )
        if (
            sys.platform != "win32"
            and target != HOST_TARGET
            and not any(
                runtime_available(runtime, cwd=project_dir)
                for runtime in ("docker", "podman")
            )
        ):
            pytest.skip("container runtime required for cross build")
        ensure_toolchain_ready(TOOLCHAIN_VERSION, HOST_TARGET)
        res = run_script(script, target, cwd=project_dir)
>       assert res.returncode == 0
E       AssertionError: assert 1 == 0
E        +  where 1 = CompletedProcess(args=['C:\\hostedtoolcache\\windows\\uv\\0.8.19\\x86_64\\uv.EXE', 'run', 'D:\\a\\shared-actions\\shar...nTimeoutExpired: Command \'[\'C:\\\\Windows\\\\system32\\\\docker.EXE\', \'info\']\' timed \nout after 10.0 seconds\n').returncode

.github\actions\rust-build-release\tests\test_smoke.py:117: AssertionError
---------------------------- Captured stdout call -----------------------------
$ rustup toolchain install 1.89.0 --profile minimal

  1.89.0-x86_64-pc-windows-msvc installed - rustc 1.89.0 (29483883e 2025-08-04)

---------------------------- Captured stderr call -----------------------------
info: syncing channel updates for '1.89.0-x86_64-pc-windows-msvc'
info: latest update on 2025-08-07, rust version 1.89.0 (29483883e 2025-08-04)
info: downloading component 'cargo'
info: downloading component 'rust-std'
info: downloading component 'rustc'
info: installing component 'cargo'
info: installing component 'rust-std'
info: installing component 'rustc'
____ test_action_builds_release_binary_and_manpage[x86_64-pc-windows-gnu] _____

target = 'x86_64-pc-windows-gnu'
ensure_toolchain_ready = <function ensure_toolchain_ready.<locals>._ensure at 0x0000020DAB9BAA20>

    @pytest.mark.parametrize("target", TARGET_PARAMS)
    def test_action_builds_release_binary_and_manpage(
        target: str, ensure_toolchain_ready: typ.Callable[[str, str], None]
    ) -> None:
        """The build script produces a release binary and man page."""
        script = Path(__file__).resolve().parents[1] / "src" / "main.py"
        project_dir = PROJECT_DIR
        if shutil.which("rustup") is None:
            pytest.skip("rustup not installed")
        # On Windows, ensure a linker exists for GNU aarch64 targets.
        if (
            sys.platform == "win32"
            and target.endswith("-pc-windows-gnu")
            and "aarch64" in target
            and shutil.which("aarch64-w64-mingw32-gcc") is None
            and shutil.which("zig") is None
        ):
            pytest.skip(
                "aarch64 GNU linker not available (need aarch64-w64-mingw32-gcc or zig)"
            )
        if (
            sys.platform != "win32"
            and target != HOST_TARGET
            and not any(
                runtime_available(runtime, cwd=project_dir)
                for runtime in ("docker", "podman")
            )
        ):
            pytest.skip("container runtime required for cross build")
        ensure_toolchain_ready(TOOLCHAIN_VERSION, HOST_TARGET)
        res = run_script(script, target, cwd=project_dir)
>       assert res.returncode == 0
E       AssertionError: assert 1 == 0
E        +  where 1 = CompletedProcess(args=['C:\\hostedtoolcache\\windows\\uv\\0.8.19\\x86_64\\uv.EXE', 'run', 'D:\\a\\shared-actions\\shar...'+1.89.0\', \'build\', \'--release\', \n\'--target\', \'x86_64-pc-windows-gnu\']\' returned non-zero exit status 1.\n').returncode

.github\actions\rust-build-release\tests\test_smoke.py:117: AssertionError
=========================== short test summary info ===========================
FAILED .github/actions/rust-build-release/tests/test_smoke.py::test_action_builds_release_binary_and_manpage[x86_64-pc-windows-msvc] - AssertionError: assert 1 == 0
 +  where 1 = CompletedProcess(args=['C:\\hostedtoolcache\\windows\\uv\\0.8.19\\x86_64\\uv.EXE', 'run', 'D:\\a\\shared-actions\\shar...nTimeoutExpired: Command \'[\'C:\\\\Windows\\\\system32\\\\docker.EXE\', \'info\']\' timed \nout after 10.0 seconds\n').returncode
FAILED .github/actions/rust-build-release/tests/test_smoke.py::test_action_builds_release_binary_and_manpage[x86_64-pc-windows-gnu] - AssertionError: assert 1 == 0
 +  where 1 = CompletedProcess(args=['C:\\hostedtoolcache\\windows\\uv\\0.8.19\\x86_64\\uv.EXE', 'run', 'D:\\a\\shared-actions\\shar...'+1.89.0\', \'build\', \'--release\', \n\'--target\', \'x86_64-pc-windows-gnu\']\' returned non-zero exit status 1.\n').returncode
============ 2 failed, 128 passed, 21 skipped in 150.03s (0:02:30) ============
Error: Process completed with exit code 1.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Sep 20, 2025

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

@leynos I'll create a GitHub issue for the Windows test failure related to Docker timeouts.


🏁 Script executed:

#!/bin/bash
# Create GitHub issue for Windows Docker timeout test failures
gh issue create \
  --title "Windows CI: Docker timeout causing rust-build-release smoke test failures" \
  --body "## Description

The rust-build-release smoke tests are failing on Windows CI runners due to Docker command timeouts.

## Error Details

Two test cases are consistently failing:
- \`test_action_builds_release_binary_and_manpage[x86_64-pc-windows-msvc]\`
- \`test_action_builds_release_binary_and_manpage[x86_64-pc-windows-gnu]\`

### Error Message
\`\`\`
AssertionError: assert 1 == 0
 +  where 1 = CompletedProcess(args=['C:\\\\hostedtoolcache\\\\windows\\\\uv\\\\0.8.19\\\\x86_64\\\\uv.EXE', 'run', 'D:\\\\a\\\\shared-actions\\\\shar...nTimeoutExpired: Command \\'[\\'C:\\\\\\\\Windows\\\\\\\\system32\\\\\\\\docker.EXE\\', \\'info\\']\\' timed \\nout after 10.0 seconds\\n').returncode
\`\`\`

The issue appears to be that Docker commands are timing out after 10 seconds on Windows runners, specifically when executing \`docker.exe info\`.

## Environment
- Platform: Windows (win32)
- Python: 3.12.10
- Runner: GitHub Actions hosted runner
- Docker: Windows system Docker

## Impact
- Smoke tests for Windows targets are failing
- CI pipeline fails when testing Windows-specific functionality

## Potential Causes
1. Docker service not properly started/configured on Windows runners
2. Network connectivity issues affecting Docker daemon
3. Performance issues on Windows runners causing timeouts
4. Missing Docker configuration for Windows containers

## References
- PR: https://github.com/leynos/shared-actions/pull/92
- Comment: https://github.com/leynos/shared-actions/pull/92#issuecomment-$(gh pr view 92 --json comments --jq '.comments[-1].id')" \
  --assignee leynos

Length of output: 50


Perfect! I've successfully created GitHub issue #93 for the Windows Docker timeout test failures. The issue has been created with:

  • Title: "Windows CI: Docker timeout causing rust-build-release smoke test failures"
  • Detailed description including the specific error messages, environment details, and potential causes
  • Assignment to you (@leynos)
  • References to this PR and the comment thread

The issue is now available at: #93

This will help track the Windows-specific Docker timeout problem separately from the cmd-mox integration work in this PR.

@leynos leynos merged commit 3c113cb into python-lib-release-action Sep 20, 2025
5 of 8 checks passed
@leynos leynos deleted the codex/stub-executable-with-cmd-mox branch September 20, 2025 10:48
leynos added a commit that referenced this pull request Sep 21, 2025
* Use cmd-mox for rust build command tests

* Guard cmd-mox integration on Windows

* Refactor cmd-mox helpers into shared conftest

* Apply cmd-mox fake which simplification
leynos added a commit that referenced this pull request Sep 21, 2025
* Use cmd-mox for rust build command tests

* Guard cmd-mox integration on Windows

* Refactor cmd-mox helpers into shared conftest

* Apply cmd-mox fake which simplification
leynos added a commit that referenced this pull request Sep 22, 2025
* Use cmd-mox for rust build command tests

* Guard cmd-mox integration on Windows

* Refactor cmd-mox helpers into shared conftest

* Apply cmd-mox fake which simplification
leynos added a commit that referenced this pull request Sep 23, 2025
* Use cmd-mox for rust build command tests

* Guard cmd-mox integration on Windows

* Refactor cmd-mox helpers into shared conftest

* Apply cmd-mox fake which simplification
leynos added a commit that referenced this pull request Sep 24, 2025
* Use cmd-mox for rust build command tests

* Guard cmd-mox integration on Windows

* Refactor cmd-mox helpers into shared conftest

* Apply cmd-mox fake which simplification
leynos added a commit that referenced this pull request Sep 24, 2025
* Add release-to-pypi-uv composite action

* Document trusted publishing permissions

* Clarify GH_TOKEN handling in README

* Fix local usage example

* Improve GitHub release error handling

* Fix cmd_utils discovery in publish script

* Skip more build caches

* Fail fast on TOML parse errors

* Format release summary output

* Add no-tag error test

* Test TOML parse failures

* Make uv python version configurable

* Document concurrency guard in usage

* Address review feedback with retries and tests

* Improve TOML version validation and test strategy

Extends boolean parsing to support more truthy values when validating dynamic version flags in TOML files. Refactors tests to run in-process with better coverage of various flag values and scenarios, replacing subprocess-based tests for efficiency and detail. Updates action to simplify Python version handling with uv and improves path detection for testing.

These changes make validation logic more robust and enhance test reliability.

* Add cmd-mox users guide

* Use cmd-mox to stub rust build command tests (#92)

* Use cmd-mox for rust build command tests

* Guard cmd-mox integration on Windows

* Refactor cmd-mox helpers into shared conftest

* Apply cmd-mox fake which simplification

* Mark Windows smoke tests as xfail (#94)

* Mark Windows smoke tests as xfail

* Tighten Windows smoke test expectations

* Address reviewer feedback for release-to-pypi-uv action (#98)

* Address review comments for release to PyPI action

* Add tests and docs for python-version handling

* Fix cmd_mox fixture usage and expose dev extra (#101)

* Fix cmd_mox fixture usage and expose dev extras

* Remove pyproject optional dev extra

* Remove Pyright configuration

* Add missing docstrings to release-to-pypi-uv modules (#103)

* Silence type-check import lints for release action (#104)

* Add toolchain-specific cargo cache key and clean shellstub imports (#88)

* Address review feedback for shellstub imports

* Fix MSYS2 install comments breaking pacman (#89)

* Fix MSYS2 install comments breaking pacman

* Fix Windows llvm-mingw metadata export

* Handle runtime detection timeouts

* Fix rust host detection timeout and Windows bin path (#91)

* Fix rust host detection timeout and Windows bin path

* Add timeout coverage for rust host detection

* Unify runtime probe timeout configuration

* test: capture rustc probe kwargs in timeout test

* Remove inline comments from Windows GNU MSYS2 package list (#99)

* Remove inline MSYS2 install comments

* Skip nfpm steps on Windows builds

* Handle nfpm packaging only for Linux

* Fix Windows invocation of rust-build-release (#102)

* Silence type-check import lints for release action

* Adds ignore rule for Crush agent artifacts

Ignores files generated by the Crush AI agent to prevent them from being tracked in version control.

Adds a symlink to AGENTS.md for discovery by Crush

* Format code after rebase validation to satisfy repo style checks.

💘 Generated with Crush
Co-Authored-By: Crush <crush@charm.land>

* fmt: extend fmt target to run ruff check --select D202,I001 --fix; apply resulting fixes

💘 Generated with Crush
Co-Authored-By: Crush <crush@charm.land>

---------

Co-authored-by: Payton McIntosh <pmcintosh@df12.net>
Co-authored-by: Crush <crush@charm.land>

* Narrow module fixtures to ModuleType (#105)

* Add docstrings for release-to-pypi-uv tests and helpers (#106)

* Add missing docstrings for release-to-pypi-uv tests

* Simplify cmd-mox typing and streamline docstrings

* Apply formatting

* chore: remove unused imports across scripts and tests

* style(_helpers): alphabetise __all__ tuple

* tests: drop superfluous parentheses from @pytest.fixture usage

---------

Co-authored-by: Payton McIntosh <pmcintosh@df12.net>

* Scope type-checking imports (#111)

* Scope type-checking imports

* Fix lint warnings across release scripts

* Clarify cargo stream capture error

* ci: add lint and format checks

* Install action-validator in CI lint workflow

* Install bun validator packages in CI

* Test full success message for matching versions (#113)

* Address review comments (#116)

* Address review feedback for release-to-pypi-uv actions (#112)

* Address review feedback

* Add CLI coverage for publish and validate scripts

* Add deterministic validation tests and bunx validator checks

* Update ci.yml remove unneeded step

* Fix formatting

* Fix Windows xfail marker removal for pytest 8 (#120)

* Fix Windows xfail marker removal for pytest 8

* Tighten Windows xfail marker filtering

* Handle runtime probe timeouts and expand release tests (#119)

* Handle runtime probe timeouts and expand release tests

* Add _probe_runtime coverage and assert timeout warnings

* Expand TOML skip directories for release validation (#122)

* Expand pyproject skip list handling

* Strengthen TOML and runtime timeout tests

* Assert cargo fallback logs podman failure

* Parameterize skip-directory regression

* Reinforce regression coverage for release tooling (#130)

* Refine skip directory regression parameterization

* Document skip directories and DRY timeout assertions

* Parametrize publish index test

* Refactor runtime timeout tests

* Rebase onto origin/python-lib-release-action and resolve conflicts

- Resolve merge in validate_toml_versions tests by standardizing module loading
- Register dynamically loaded scripts in sys.modules to support reload semantics
- Make toolchain triple test robust to host arch by selecting matching target
- Run formatting, lint, typecheck, and tests to validate integration

💘 Generated with Crush
Co-Authored-By: Crush <crush@charm.land>

---------

Co-authored-by: Crush <crush@charm.land>

* Harden release-to-pypi-uv workflow and regression coverage (#134)

* Improve release validation jitter handling

* Adjust runtime fallback host triples per platform

* Make release validation deterministic and configurable

* Rebase python-lib-release-action onto origin/main; resolve conflicts preserving branch intent; drop uv.lock in favor of main; fix tests and typing/lint issues; all tests pass and linters clean

* Close cargo pipes when coverage stream missing (#137)

* Close cargo pipes when missing

* Ensure cargo pipes close on all paths

* Ensure guard closes cargo pipes before exiting

* Handle release script auth failure and multiline outputs (#136)

* Handle release script auth failure and multiline outputs

* Harden windows toolchain setup and extend runtime tests

* Handle release auth errors and tweak toolchain retries

* Fix cross install warning expectation (#139)

* Fix cross install warning assertion

* Harden cross install harness checks

* Sanitize runtime probe timeout and guard actions

* Refine runtime probe helpers and add timeout tests

* Fix runtime probe lint findings

* Share echo recorder fixture across runtime tests

* Update fmt target description (#140)

* Resolve rebase conflicts and align runtime tests with platform/timeouts from main while preserving branch improvements; ensure formatting passes and all tests/linters are green.

💘 Generated with Crush
Co-Authored-By: Crush <crush@charm.land>

---------

Co-authored-by: Payton McIntosh <pmcintosh@df12.net>
Co-authored-by: Crush <crush@charm.land>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant