fix(ci): smoke test type-checks the README quickstart#11
Merged
Conversation
…lt dist
The smoke test was failing for two unrelated reasons that the misleading
\`no quickstart code block found\` error message hid:
1. \`/tmp/quickstart.ts\` ran \`new Driver()\`, which dials a daemon socket.
CI has no daemon — the constructor throws \`Cannot find module 'pilotprotocol'\`
when run from /tmp because the package isn't installed there either.
2. The intent ("did we break the user's copy-paste?") doesn't actually
need execution; type-checking the snippet against the built
\`dist/index.d.ts\` catches the renames-and-signature-drifts that
the smoke is really there to guard.
Replaces the \`npx tsx /tmp/quickstart.ts\` run with a type-check inside
the repo: extract the same block to smoke-tmp/quickstart.ts, drop a
tsconfig with \`paths.pilotprotocol → ../dist/index.d.ts\`, run \`tsc -p\`.
No daemon, no global install. Runs in ~3s.
Verified locally: \`tsc\` exits 0 against the current README.
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
The `SDK examples smoke test` workflow has been failing on every push
since the workflow was added, and the failure message was misleading:
```
::error::no quickstart code block found in README.md
```
Actual cause was below it in the log:
```
Error: Cannot find module 'pilotprotocol'
```
Two unrelated bugs in the test design:
has no `node_modules` so `import 'pilotprotocol'` couldn't resolve.
which dials a daemon socket. CI has no daemon, so it'd throw at
construction time.
What's left
Replaces the execution with a type-check inside the repo:
the import resolves to the freshly-built typings.
This catches the renames-and-signature-drifts that the smoke is
actually there to guard ("did we break the user's copy-paste?").
Runtime behaviour drift would need a real daemon-spinup test, which is
worth doing separately, but at minimum we now stop the silent failure.
Test plan