Fix robot command not found when installed via uv tool#718
Merged
Conversation
This reverts commit 1359951.
oboehmer
approved these changes
Mar 26, 2026
Collaborator
oboehmer
left a comment
There was a problem hiding this comment.
approved.. we need to see how we can properly test the uv tool .. installation method, this is clearly a test escape. I am building a v2.0.0b2 with this fix for now
oboehmer
approved these changes
Mar 26, 2026
Collaborator
oboehmer
left a comment
There was a problem hiding this comment.
will push a different fix as discussed.. also raise an issue to properly test this in the pipeline
…ecutable
Use sysconfig.get_path("scripts") / "robot" to locate the robot binary,
consistent with the existing pyats subprocess runner pattern. This also
adds an upfront existence check with a clear RuntimeError message rather
than failing deep inside pabot with a cryptic error.
Adds unit tests covering correct resolution, missing-binary error, and
verifying pabot is never invoked when the binary is absent.
60205f0 to
1b9ec32
Compare
oboehmer
added a commit
that referenced
this pull request
Mar 26, 2026
…#611, #719) Replace CliRunner with subprocess.run() in E2E tests, eliminating the pabot writer singleton workaround and giving each scenario a fully isolated process. A new test-e2e CI job installs nac-test via `uv tool install` before running E2E tests, exercising the exact entrypoint path that end-users get and catching regressions like #718 (robot not found in isolated venv). - Remove _reset_pabot_writer() singleton hack from e2e/conftest.py - Replace CliRunner.invoke() with subprocess.run(), passing env dict directly (no more class_mocker/monkeypatching) - Remove class_mocker fixture (no longer needed anywhere) - Update test_cli_has_no_exception to check stderr for tracebacks (module-level import errors bypass CLI exception handling and land in stderr — verified by injecting a fake import error) - Add test-e2e CI job (full 4-Python matrix, Linux): installs via `uv tool install`, verifies `which nac-test` resolves to the uv tool bin dir, then runs pytest tests/e2e/ against that entrypoint - Exclude tests/e2e from the existing test job (moved to test-e2e) - Update notification job to include test-e2e in needs/success check
oboehmer
added a commit
that referenced
this pull request
Mar 26, 2026
…719) Replace the separate `uv sync` + `uv run pytest` steps in the `test-e2e` job with a single `uv tool install --with pytest --with pytest-xdist --with pytest-httpserver --with flask` invocation. pytest now runs directly inside the isolated tool environment alongside nac-test, with no dev venv on PATH to shadow the tool env's robot binary. This correctly reproduces the end-user scenario and ensures regressions like #718 (pabot unable to locate robot in an isolated venv) are caught by CI.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
sys.executable -m robotinstead of barerobotfor pabot subprocess invocationuv tool install)Root cause
Pabot spawns
robotas a subprocess by name. When nac-test is installed viauv tool install, therobotbinary lives inside the isolated venv and is not on the system PATH.Fix
Pass
--command <python> -m robot --end-commandto pabot so it invokes robot through the current Python interpreter, which always resolves to the correct venv.