Skip to content

fix(ci): smoke test type-checks the README quickstart#11

Merged
TeoSlayer merged 1 commit into
mainfrom
fix/smoke-typecheck-not-execute
Jun 9, 2026
Merged

fix(ci): smoke test type-checks the README quickstart#11
TeoSlayer merged 1 commit into
mainfrom
fix/smoke-typecheck-not-execute

Conversation

@TeoSlayer

Copy link
Copy Markdown
Contributor

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:

  1. `/tmp/quickstart.ts` ran `npx tsx /tmp/quickstart.ts`, but `/tmp/`
    has no `node_modules` so `import 'pilotprotocol'` couldn't resolve.
  2. Even if the import resolved, the snippet calls `new Driver()` —
    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:

  • Extract the same block to `smoke-tmp/quickstart.ts` (gitignored).
  • Drop a tsconfig with `paths.pilotprotocol → ../dist/index.d.ts` so
    the import resolves to the freshly-built typings.
  • Run `npx tsc -p` — no daemon, no global install, ~3s.

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

  • Local `tsc` exits 0 against the current README quickstart

…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.
@TeoSlayer TeoSlayer merged commit 870d793 into main Jun 9, 2026
5 checks passed
@TeoSlayer TeoSlayer deleted the fix/smoke-typecheck-not-execute branch June 9, 2026 06:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants