Skip to content

test(miner): add true CLI end-to-end integration tests - #5565

Merged
loopover-orb[bot] merged 2 commits into
JSONbored:mainfrom
jsdevninja:feat/miner-cli-e2e-tests
Jul 13, 2026
Merged

test(miner): add true CLI end-to-end integration tests#5565
loopover-orb[bot] merged 2 commits into
JSONbored:mainfrom
jsdevninja:feat/miner-cli-e2e-tests

Conversation

@jsdevninja

@jsdevninja jsdevninja commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add \ est/unit/miner-cli-e2e.test.ts, a small suite that spawns the real \gittensory-miner\ binary (not injected fakes) for the most-used local flows.
  • Extend \miner-cli-harness\ with a GitHub-compatible forge HTTP fixture,
    unCliResult, and async
    unAsync\ result metadata so discover/queue runs can be asserted reliably across platforms.

Coverage

  • \init\ → \status --json\ → \doctor --json\ through the bin with an isolated \GITTENSORY_MINER_CONFIG_DIR\
  • \discover --dry-run\ and \discover --search --dry-run\ against the local forge fixture via --api-base-url\
  • Full \discover\ enqueue plus \queue list\ and \queue next --dry-run\ on the real portfolio queue store

Closes #4869

Test plan

  • \px vitest run test/unit/miner-cli-e2e.test.ts\

Spawn the real gittensory-miner binary against a local forge fixture to cover init, status, doctor, discover, and queue flows (Closes JSONbored#4869).

Co-authored-by: Cursor <cursoragent@cursor.com>
@jsdevninja
jsdevninja requested a review from JSONbored as a code owner July 13, 2026 05:29
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@jsdevninja
jsdevninja marked this pull request as draft July 13, 2026 05:31
@codecov

codecov Bot commented Jul 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.91%. Comparing base (df5336e) to head (50f22a2).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5565   +/-   ##
=======================================
  Coverage   94.91%   94.91%           
=======================================
  Files         570      570           
  Lines       45351    45351           
  Branches    14675    14675           
=======================================
  Hits        43046    43046           
  Misses       1571     1571           
  Partials      734      734           
Flag Coverage Δ
shard-1 44.14% <ø> (-0.01%) ⬇️
shard-2 35.73% <ø> (+0.02%) ⬆️
shard-3 31.94% <ø> (+<0.01%) ⬆️
shard-4 31.85% <ø> (-0.03%) ⬇️
shard-5 32.71% <ø> (-0.30%) ⬇️
shard-6 44.41% <ø> (+0.25%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@loopover-orb loopover-orb Bot added the gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. label Jul 13, 2026
Co-authored-by: Cursor <cursoragent@cursor.com>
@loopover-orb

loopover-orb Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Tip

🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩

✅ Gittensory review result - approve/merge recommended

Review updated: 2026-07-13 05:39:55 UTC

2 files · 2 AI reviewers · no blockers · readiness 100/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This PR adds true CLI end-to-end tests spawning the real gittensory-miner binary against a local GitHub-compatible forge fixture, and extends the harness with typed CLI result metadata (status/stdout/stderr) plus a forge fixture server for discover/queue flows. The tests look well-targeted at the real binary boundary rather than mocked internals, and the harness changes (runCliResult, updated runAsync signature) are consistent and used correctly across the new test file. CI shows validate-code failed on this commit, which is worth checking before merge even though it's not necessarily a defect in the reviewed logic itself.

Nits — 6 non-blocking
  • The 'GITHUB_TOKEN: e2e-fixture-token' in test/unit/miner-cli-e2e.test.ts:17 is a hardcoded fixture placeholder, not a real secret, but consider naming it more explicitly like 'FIXTURE_GITHUB_TOKEN' or adding a comment to avoid future confusion with secret scanners.
  • expectCliSuccess in test/unit/miner-cli-e2e.test.ts:19-23 silently accepts non-zero exit codes on the documented Windows libuv quirk without asserting the JSON payload was actually produced correctly beyond non-empty stdout — consider also validating JSON.parse succeeds in that branch.
  • resolveForgeRepo in miner-cli-harness.ts falls back to a default fixture issue (number 42) when no matching repo is configured, which is convenient but could mask a typo in test repo names silently returning unexpected fixture data instead of failing loudly.
  • The /search/issues handler in miner-cli-harness.ts always uses repos[0] regardless of the actual search query stub sent by the CLI, which is fine for current tests but is a simplification worth a one-line comment so future contributors don't assume real query filtering is fixture-simulated.
  • Consider asserting on the exact JSON shape (not just presence) in the Windows-fallback branch of expectCliSuccess to keep coverage meaningful on non-zero-status runs.
  • Possible secret-shaped assignment in the diff (generic_secret_assignment) — Verify the value is not a real credential.
Signal Result Evidence
Code review ✅ No blockers 2 reviewers, synthesized
Linked issue ✅ Linked #4869
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 237 registered-repo PR(s), 145 merged, 39 issue(s).
Contributor context ✅ Confirmed Gittensor contributor jsdevninja; Gittensor profile; 237 PR(s), 39 issue(s).
Gate result ✅ Passing No configured blocker found.
Improvement ⚠️ ℹ️ Insufficient signal risk: clean · value: insufficient-signal — Nothing measurable for the structural-improvement analyzers on this PR (e.g. no code files changed). LLM value judgment: moderate — The PR closes issue #4869 by replacing/augmenting mocked CLI tests with real binary spawns against a realistic forge fixture, which meaningfully increases confidence in the actual discover/queue/doctor flows working end-to-end.
Review context
  • Author: jsdevninja
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: not available
  • Official Gittensor activity: 237 PR(s), 39 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Keep the PR focused and include validation evidence before maintainer review.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
[BETA] Chat with Gittensory

Ask Gittensory a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.

  • @gittensory ask &lt;question&gt; answers contribution-quality Q&A with source citations and freshness.
  • @gittensory chat &lt;question&gt; answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @gittensory mention with a real question is routed to the closest matching read-only command automatically -- no exact syntax required.

Full command reference: https://gittensory.aethereal.dev/docs/gittensory-commands

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.

  • Re-run Gittensory review

@jsdevninja
jsdevninja marked this pull request as ready for review July 13, 2026 05:37

@loopover-orb loopover-orb Bot 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.

Gittensory approves — the gate is satisfied and CI is green.

@loopover-orb
loopover-orb Bot merged commit 6ecd26a into JSONbored:main Jul 13, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add more true end-to-end integration tests

1 participant