Skip to content

docs(contributing): recommend scripts/run_tests.sh over direct pytest - #44482

Closed
sakakibara-yuuki wants to merge 1 commit into
NousResearch:mainfrom
sakakibara-yuuki:docs/contributing-run-tests-script
Closed

docs(contributing): recommend scripts/run_tests.sh over direct pytest#44482
sakakibara-yuuki wants to merge 1 commit into
NousResearch:mainfrom
sakakibara-yuuki:docs/contributing-run-tests-script

Conversation

@sakakibara-yuuki

Copy link
Copy Markdown

What

Replace pytest tests/ -v with scripts/run_tests.sh in the website contributing guide (website/docs/developer-guide/contributing.md, both the "Run Tests" section and the "Before Submitting" checklist).

Why

The published docs page (https://hermes-agent.nousresearch.com/docs/developer-guide/contributing#run-tests) still tells contributors to run pytest tests/ directly, but the repo's own guidance has since moved on:

  • AGENTS.md: "ALWAYS use scripts/run_tests.sh — do not call pytest directly."
  • CONTRIBUTING.md: lists scripts/run_tests.sh as the preferred, CI-matching runner.
  • tests/conftest.py: documents that the suite relies on per-file process isolation provided by scripts/run_tests_parallel.py.

Following the website instructions as written actually breaks: several fixtures evict hermes_cli* modules from sys.modules (e.g. tests/hermes_cli/test_kanban_*.py), so in a monolithic pytest tests/ run, later test files' monkeypatch.setattr calls land on re-imported module objects and silently miss. Mocked network calls then escape for real and hang in socket.getaddrinfo until pytest-timeout fires. Reproducible with just two files:

pytest tests/hermes_cli/test_kanban_default_assignee.py tests/hermes_cli/test_nous_account.py
# -> test_expired_jwt_falls_back_to_fresh_account times out in getaddrinfo

Same class of order-dependent sys.modules poisoning as #33079, but hitting anyone who follows the published docs.

How to test

Docs-only change; scripts/run_tests.sh is the existing canonical runner documented in AGENTS.md and CONTRIBUTING.md.

The website contributing guide still tells contributors to run
`pytest tests/ -v`, but the test suite relies on per-file process
isolation (see tests/conftest.py): several fixtures evict hermes_cli*
modules from sys.modules, so a monolithic pytest run lets later test
files' monkeypatches land on re-imported module objects and miss,
leaking real network calls that hang in getaddrinfo until
pytest-timeout fires.

CONTRIBUTING.md and AGENTS.md were already updated to point at
scripts/run_tests.sh ("ALWAYS use scripts/run_tests.sh — do not call
pytest directly"); this brings the website doc in line.
Copilot AI review requested due to automatic review settings June 11, 2026 21:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Updates the contributing guide to standardize test execution via the repository’s test runner script instead of invoking pytest directly.

Changes:

  • Replace the documented test command in “Run Tests” with scripts/run_tests.sh
  • Replace the “Before Submitting” checklist test command with scripts/run_tests.sh

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


```bash
pytest tests/ -v
scripts/run_tests.sh
### Before Submitting

1. **Run tests**: `pytest tests/ -v`
1. **Run tests**: `scripts/run_tests.sh`
@alt-glitch alt-glitch added type/docs Documentation improvements comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have labels Jun 11, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Thanks for identifying the contributor-documentation mismatch. This is an automated hermes-sweeper review; current main already contains the requested guidance.

  • website/docs/developer-guide/contributing.md:137 documents scripts/run_tests.sh in Run Tests, added by 975b9f0a5426858c3ae7f0d4e54701c08824bd09.
  • website/docs/developer-guide/contributing.md:241 recommends scripts/run_tests.sh for CI parity in Before Submitting, added by 2008a96b2054e3c9698d43a6fa6417de9742d1e9; it also documents the limited direct-pytest debugging exception.
  • The linked docs(contributing): fix incorrect xdist reference in run_tests comment #54956 concerns a separate root-CONTRIBUTING.md wording correction about xdist rather than this website-guide change.

Closing as implemented on main.

@teknium1 teknium1 closed this Jul 14, 2026
@teknium1 teknium1 added the sweeper:implemented-on-main Sweeper: behavior already present on current main label Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have sweeper:implemented-on-main Sweeper: behavior already present on current main type/docs Documentation improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants