Skip to content

fix(skills): set PYTHON_CMD in run_unittests_python.sh - #50

Merged
NejcS merged 1 commit into
plainlang:mainfrom
Khunjua:fix/run-unittests-python
Nov 17, 2026
Merged

NejcS merged 1 commit into
plainlang:mainfrom
Khunjua:fix/run-unittests-python

Conversation

@Khunjua

@Khunjua Khunjua commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

run_unittests_python.sh uses $PYTHON_CMD to create the venv but never sets it, so on every OS it fails with "-m: command not found" (exit 69) before any test runs. This sets it the same way run_conformance_tests_python.sh does.

One more thing I hit on macOS: the script calls timeout, which macOS doesn't ship, so it then fails with exit 127. The copy in Codeplain-ai/codeplain/test_scripts has no timeout, since the renderer already limits the run with test-script-timeout. Happy to send a follow-up either dropping it or falling back to gtimeout, whichever you prefer.

npm test: 82/82 pass.

Summary by CodeRabbit

  • Bug Fixes
    • The unit test setup now uses Python 3 when available and falls back to Python if needed. If neither interpreter is installed, it displays an error and exits with a clear failure status. This makes interpreter selection more reliable and helps identify why test setup could not continue.

The script used $PYTHON_CMD without setting it, so creating the venv
failed with "-m: command not found" (exit 69) before any test ran.
Set it the same way run_conformance_tests_python.sh does.
@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The script now prefers python3, falls back to python, and exits with code 69 if neither command is available. It uses the selected interpreter to create the virtual environment.

Changes: Python Interpreter Selection

Layer / File(s) Summary
Interpreter detection and virtual environment setup
forge/skills/implement-unit-testing-script/assets/run_unittests_python.sh
The script checks for python3 first and then python. If neither command exists, it prints an error and exits with code 69. The selected interpreter creates the virtual environment.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Suggested reviewers: nejcs, zanjonke

Merge Risk: Minimal · up to dbee4

The script now selects an available Python interpreter instead of failing with a command-not-found error. The change is small and no merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the change: it fixes the unset PYTHON_CMD variable in run_unittests_python.sh. The changeset sets the interpreter (python3, falling back to python) and exits with code 69 when neither …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the change: it fixes the unset PYTHON_CMD variable in run_unittests_python.sh. The changeset sets the interpreter (python3, falling back to python) and exits with code 69 when neither exists, which matches the title's main point. The title uses the conventional commit form and is specific enough for history scanning.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: db9bf55e-1d27-4349-b635-9581b07ec4a3
Commits

Reviewing files that changed from the base of the PR and between 2e3b89a and dbee404.

Files selected for processing: 1

  • forge/skills/implement-unit-testing-script/assets/run_unittests_python.sh

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

@NejcS NejcS left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@Khunjua thanks for contributing!

I agree, the python interpreter check should be in this asset script as well.

And you are right about the timeout, it's not needed in the script since the codeplain renderer limits the test scripts run already. You can add that change if you want otherwise I'll update the assets scripts.

@NejcS

NejcS commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

I opened a separate PR #51 for that timeout removal and I'll merge this one.

@NejcS
NejcS merged commit a829e17 into plainlang:main Nov 17, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants