Skip to content

test: parallelize test suite with pytest-xdist#802

Merged
teknium1 merged 1 commit into
mainfrom
feat/parallelize-tests
Mar 11, 2026
Merged

test: parallelize test suite with pytest-xdist#802
teknium1 merged 1 commit into
mainfrom
feat/parallelize-tests

Conversation

@OutThisLife

Copy link
Copy Markdown
Collaborator

What does this PR do?

Adds pytest-xdist to run the test suite in parallel across all CPU cores. Cuts wall-clock time from ~2min to ~30s locally.

Type of Change

  • ✅ Tests (adding or improving test coverage)

Changes Made

  • pyproject.toml: added pytest-xdist to [dev] deps, added -n auto to default addopts
  • .github/workflows/tests.yml: added -n auto to CI pytest invocation

How to Test

  1. uv pip install -e ".[all,dev]"
  2. pytest tests/ -q --ignore=tests/integration --tb=short
  3. Confirm tests run across multiple workers and pass (2677 passed, 1 skipped)

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature
  • I've run pytest tests/ -q and all tests pass
  • I've tested on my platform: Ubuntu (WSL2)

Documentation & Housekeeping

  • N/A — no docs, config, or architecture changes

~2min sequential runs were painful. Added pytest-xdist and -n auto
to run across all available cores. Tests already isolate state via
tmp_path fixtures so no changes needed to test code.

Local: 2677 passed in ~30s. CI gets 4 vCPUs on ubuntu-latest.
@OutThisLife OutThisLife requested a review from teknium1 March 10, 2026 17:45
@teknium1 teknium1 merged commit 1dfa544 into main Mar 11, 2026
1 check failed
@teknium1

Copy link
Copy Markdown
Contributor

Merged in 1dfa544. Thanks @OutThisLife — nice quality-of-life improvement for the test suite! 🚀

lmsanch added a commit to lmsanch/hermes-agent that referenced this pull request Apr 22, 2026
…play protection (NousResearch#718) (#6)

Operationalizes the A2A cryptographic identity spec in
docs/strategic/A2A_CRYPTO_IDENTITY.md (filed as toryx-private#820).
This is the module downstream issues NousResearch#801, NousResearch#802, and NousResearch#812 integrate
against; it replaces the env-var trust shim in research_mcp whitelist.

New module `tools/agent_identity.py`:

- generate_identity(profile_name, force=False)
  Writes an Ed25519 private key (PKCS8 PEM) to
  ~/.hermes/profiles/<profile>/keys/ed25519_private.pem (chmod 600) and
  registers the raw public key in ~/.hermes/identity_registry.yaml.
  Refuses overwrite without force=True so rotation is explicit.

- sign_envelope(profile_name, recipient, body, host=None)
  Canonical-JSON envelope per spec §4: sender_agent, sender_host,
  recipient_agent, nonce (128 bit hex), timestamp (ISO8601 UTC),
  body_sha256, body, signature. Signature covers everything except the
  signature field itself.

- verify_envelope(envelope)
  Per spec §5 verification flow: missing-fields check → timestamp window
  (5 min) → body_sha256 integrity → nonce LRU replay (10k entries) →
  pubkey lookup → Ed25519 verify. On ANY failure returns non-valid
  result — callers drop silently, no reply (prevents loop amplification
  + reply-ack exfil per NousResearch#716 lessons).

- canonical_json(obj)
  Exposed utility — sorted keys, UTF-8, no whitespace. Same shape as the
  toryx-openratings anchor payload canonical form.

Tests:
- Round-trip sign/verify
- Replay rejection (same nonce twice)
- Timestamp-out-of-window rejection
- Unknown sender rejection
- Bad signature rejection
- Tampered body rejection (body_sha256 integrity catch)
- Missing fields rejection
- Canonical JSON is deterministic across key orderings
- Two-agent talk (cross-identity verification)
- Nonce LRU eviction semantics

Not in scope (v2):
- Key rotation with 30-day pubkey overlap
- HSM-backed private key storage
- Transport bindings (telegram X-header, email header, consult_colleague
  inline field) — those land in each platform adapter

Closes lmsanch/toryx-private#718
angelburgosrosado pushed a commit to angelburgosrosado/hermes-agent that referenced this pull request Apr 27, 2026
…dist

Adds pytest-xdist to dev dependencies and -n auto to default pytest addopts
for parallel test execution across CPU cores.

Authored by OutThisLife.

Co-authored-by: OutThisLife <OutThisLife@users.noreply.github.com>
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 2026
…dist

Adds pytest-xdist to dev dependencies and -n auto to default pytest addopts
for parallel test execution across CPU cores.

Authored by OutThisLife.

Co-authored-by: OutThisLife <OutThisLife@users.noreply.github.com>
olympus-terminal pushed a commit to olympus-terminal/hermes-agent that referenced this pull request May 16, 2026
…dist

Adds pytest-xdist to dev dependencies and -n auto to default pytest addopts
for parallel test execution across CPU cores.

Authored by OutThisLife.

Co-authored-by: OutThisLife <OutThisLife@users.noreply.github.com>
lmsanch added a commit to lmsanch/hermes-agent that referenced this pull request May 23, 2026
…play protection (NousResearch#718) (#6)

Operationalizes the A2A cryptographic identity spec in
docs/strategic/A2A_CRYPTO_IDENTITY.md (filed as toryx-private#820).
This is the module downstream issues NousResearch#801, NousResearch#802, and NousResearch#812 integrate
against; it replaces the env-var trust shim in research_mcp whitelist.

New module `tools/agent_identity.py`:

- generate_identity(profile_name, force=False)
  Writes an Ed25519 private key (PKCS8 PEM) to
  ~/.hermes/profiles/<profile>/keys/ed25519_private.pem (chmod 600) and
  registers the raw public key in ~/.hermes/identity_registry.yaml.
  Refuses overwrite without force=True so rotation is explicit.

- sign_envelope(profile_name, recipient, body, host=None)
  Canonical-JSON envelope per spec §4: sender_agent, sender_host,
  recipient_agent, nonce (128 bit hex), timestamp (ISO8601 UTC),
  body_sha256, body, signature. Signature covers everything except the
  signature field itself.

- verify_envelope(envelope)
  Per spec §5 verification flow: missing-fields check → timestamp window
  (5 min) → body_sha256 integrity → nonce LRU replay (10k entries) →
  pubkey lookup → Ed25519 verify. On ANY failure returns non-valid
  result — callers drop silently, no reply (prevents loop amplification
  + reply-ack exfil per NousResearch#716 lessons).

- canonical_json(obj)
  Exposed utility — sorted keys, UTF-8, no whitespace. Same shape as the
  toryx-openratings anchor payload canonical form.

Tests:
- Round-trip sign/verify
- Replay rejection (same nonce twice)
- Timestamp-out-of-window rejection
- Unknown sender rejection
- Bad signature rejection
- Tampered body rejection (body_sha256 integrity catch)
- Missing fields rejection
- Canonical JSON is deterministic across key orderings
- Two-agent talk (cross-identity verification)
- Nonce LRU eviction semantics

Not in scope (v2):
- Key rotation with 30-day pubkey overlap
- HSM-backed private key storage
- Transport bindings (telegram X-header, email header, consult_colleague
  inline field) — those land in each platform adapter

Closes lmsanch/toryx-private#718
Egavasyug pushed a commit to Egavasyug/hermes-agent that referenced this pull request Jun 10, 2026
…dist

Adds pytest-xdist to dev dependencies and -n auto to default pytest addopts
for parallel test execution across CPU cores.

Authored by OutThisLife.

Co-authored-by: OutThisLife <OutThisLife@users.noreply.github.com>
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