fix(test): stop hardcoding the current miner version as a golden value - #5891
Merged
Conversation
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
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
force-pushed
the
fix/miner-cli-version-golden-value
branch
from
July 14, 2026 21:44
fed783f to
5a47f50
Compare
This was referenced Jul 15, 2026
Closed
Closed
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
test/unit/miner-cli.test.tshad two tests that hardcoded the miner package's current real version ("2.0.0") as a literal expectation, instead of comparing against the actual livepackages/loopover-miner/package.jsonversion. 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.test/unit/*.test.tsfor 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", ...),apiVersionwhich 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
type(scope): short summaryConventional Commit format.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
git diff --checknpm run typecheck(after rebuilding@loopover/engine, whosedist/was stale in this worktree for an unrelated reason)npx vitest run test/unit/miner-cli.test.ts— 24/24 passingnpm run test:coverage— skipped;test/**is not measured by Codecov (src/**only), and nosrc/files changed.npm run test:workers/npm run build:mcp/npm run test:mcp-pack/npm run ui:*— skipped, unaffected by a singletest/unit/**file change.npm audit --audit-level=moderate— skipped, no dependency changes.If any required check was skipped, explain why:
test/unit/miner-cli.test.ts), nosrc/, 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
UI Evidencesection. — N/A, no UI changes.CHANGELOG.md.Notes
minerrelease-please PR (chore(release): cut miner v3.0.0 #5736) failedvalidate-tests (2)even after the engine-dependency-ordering issue was resolved.