Skip to content

Run CLI tests against the checkout - #159

Open
njzjz-bot wants to merge 1 commit into
deepmodeling:masterfrom
njzjz-bot:codex/issue-123
Open

Run CLI tests against the checkout#159
njzjz-bot wants to merge 1 commit into
deepmodeling:masterfrom
njzjz-bot:codex/issue-123

Conversation

@njzjz-bot

Copy link
Copy Markdown
Contributor

Summary

  • centralize the checkout CLI command as sys.executable -m dargs
  • replace every PATH-dependent dargs subprocess invocation
  • keep stdin and error-path coverage unchanged

Fixes #123.

Validation

  • python -m unittest -v tests.test_cli with the generated version artifact available
  • Ruff checks on changed files

AI attribution

Coding agent: Codex
Codex version: codex-cli 0.149.0
Model: gpt-5.6-sol
Reasoning effort: xhigh

Coding-Agent: Codex
Codex-Version: codex-cli 0.149.0
Model: gpt-5.6-sol
Reasoning-Effort: xhigh
@coderabbitai

coderabbitai Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 38a18ec2-0c27-4544-becb-38923a0dbf02


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

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

@njzjz-bot njzjz-bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Review result: one medium-severity issue found.

The replacement removes dependence on the dargs console script in PATH, but it still does not reliably pin child processes to the checkout. See the inline finding.

I reproduced seven CLI-test failures when unittest discovery was launched outside the repository: the parent imported the checkout, while child python -m dargs commands selected an older installed package. Root-directory CI remains green.

Coding agent: Codex
Codex version: codex-cli 0.149.0
Model: gpt-5.6-sol
Reasoning effort: xhigh

Comment thread tests/test_cli.py
from pathlib import Path

this_directory = Path(__file__).parent
DARGS_COMMAND = [sys.executable, "-m", "dargs"]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

[P2] Pin subprocess module resolution to the checkout

python -m dargs resolves from the child process's working directory, not from the parent test runner's in-memory sys.path, so this constant does not reliably select the checkout. Running unittest discovery from /tmp imported these tests from the PR checkout in the parent, but the subprocesses selected an older installed dargs; I reproduced four errors and three failures with the old CLI that only exposed check. Please run the CLI subprocesses with cwd=this_directory.parent (preferably through a helper), or explicitly prepend the repository root to each child's PYTHONPATH.

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.

[Code scan] Make CLI tests invoke the checkout under test instead of PATH dargs

1 participant