fix: resolve CLI path for tier-check conformance subprocess#175
Open
DePasqualeOrg wants to merge 1 commit intomodelcontextprotocol:mainfrom
Open
fix: resolve CLI path for tier-check conformance subprocess#175DePasqualeOrg wants to merge 1 commit intomodelcontextprotocol:mainfrom
DePasqualeOrg wants to merge 1 commit intomodelcontextprotocol:mainfrom
Conversation
Use process.argv[1] instead of relative dist/index.js so tier-check works when invoked via npx or from outside the package directory.
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.
Problem
tier-checkshells out to run conformance tests using a relative path:When invoked via
npx(or from any directory other than the conformance package root),process.cwd()points to the user's working directory, not the package directory.dist/index.jsdoesn't exist there, so the command fails silently (the error is caught on the next line), the output directory is empty, andreconcileWithExpectedcounts every expected scenario as a failure — producing 0% conformance scores.Fix
Replace
node dist/index.jswithnode "${process.argv[1]}", which resolves to the absolute path of the currently running CLI entry point regardless of working directory. Also removes the now-unnecessarycwd: process.cwd().Testing
Ran
tier-checkfrom/tmpagainst my Swift SDK's conformance server.Related
PR #168 addresses a similar issue on Windows (single-quote quoting in
execSync) but retains the relativedist/index.jspath, so thenpxproblem would persist even after that fix.Breaking Changes
None
Types of changes
Checklist
I have added appropriate error handling(n.a.)I have added or updated documentation as needed(n.a.)