Skip to content

fix(test): stop hardcoding the current miner version as a golden value - #5891

Merged
JSONbored merged 1 commit into
mainfrom
fix/miner-cli-version-golden-value
Jul 14, 2026
Merged

fix(test): stop hardcoding the current miner version as a golden value#5891
JSONbored merged 1 commit into
mainfrom
fix/miner-cli-version-golden-value

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

  • test/unit/miner-cli.test.ts had two tests that hardcoded the miner package's current real version ("2.0.0") as a literal expectation, instead of comparing against the actual live packages/loopover-miner/package.json version. That means both tests were guaranteed to fail on every future miner version bump — confirmed live on the miner-v3.0.0 release PR (chore(release): cut miner v3.0.0 #5736).
  • packages/loopover-mcp's equivalent test (mcp-cli-basics.test.ts:121) already does this correctly (`@loopover/mcp/${mcpPackageJson.version}`, read dynamically). This PR matches that existing pattern for miner instead of inventing something new.
  • Grepped test/unit/*.test.ts for the same anti-pattern elsewhere; everything else that hardcodes a semver-shaped literal is a synthetic fixture value passed into a pure function (e.g. bumpVersion("0.4.2", ...), apiVersion which is a separate stable API-schema constant, not a package version) — this was the only real instance of a golden-pinned live package version.

Scope

  • The PR title follows type(scope): short summary Conventional Commit format.
  • This PR is focused and does not mix unrelated backend, UI, MCP, docs, dependency, and deploy changes.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • I linked a currently open issue this PR resolves — maintainer PR fixing a test defect discovered live on chore(release): cut miner v3.0.0 #5736, no linked issue.

Validation

  • git diff --check
  • npm run typecheck (after rebuilding @loopover/engine, whose dist/ was stale in this worktree for an unrelated reason)
  • npx vitest run test/unit/miner-cli.test.ts — 24/24 passing
  • npm run test:coverage — skipped; test/** is not measured by Codecov (src/** only), and no src/ files changed.
  • npm run test:workers / npm run build:mcp / npm run test:mcp-pack / npm run ui:* — skipped, unaffected by a single test/unit/** file change.
  • npm audit --audit-level=moderate — skipped, no dependency changes.

If any required check was skipped, explain why:

  • This change is scoped to one existing test file (test/unit/miner-cli.test.ts), no src/, dependency, or UI changes, so the full coverage/build/UI checks have no new surface to exercise. The affected test file itself was run directly and passes.

Safety

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise, and does not imply compensation guarantees or optimization tactics.
  • Auth, cookie, CORS, GitHub App, Cloudflare, or session changes include negative-path tests. — N/A.
  • API/OpenAPI/MCP behavior is updated and tested where needed. — N/A.
  • UI changes use live API data or real empty/error/loading states. — N/A, no UI changes.
  • Visible UI changes include a UI Evidence section. — N/A, no UI changes.
  • Public docs/changelogs are updated where needed; changelogs are only edited for release-prep PRs. — this PR does not touch CHANGELOG.md.

Notes

@superagent-security

Copy link
Copy Markdown
Contributor

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

@JSONbored JSONbored self-assigned this Jul 14, 2026
test/unit/miner-cli.test.ts asserted the CLI's --version output and
packages/loopover-miner/package.json's version equal a literal "2.0.0",
so the test broke on every miner version bump (confirmed live on the
miner-v3.0.0 release PR, #5736). packages/loopover-mcp's equivalent test
(mcp-cli-basics.test.ts) already reads its package.json version
dynamically -- match that pattern here so this compares the CLI's
resolved version against the real current package.json version instead
of a frozen literal, which is what both tests' own names already claimed
to check.
@JSONbored
JSONbored force-pushed the fix/miner-cli-version-golden-value branch from fed783f to 5a47f50 Compare July 14, 2026 21:44
@JSONbored
JSONbored merged commit d54d7b8 into main Jul 14, 2026
14 checks passed
@JSONbored
JSONbored deleted the fix/miner-cli-version-golden-value branch July 14, 2026 22:00
@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 14, 2026
This was referenced Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant