fix: restore CI test execution and repair CJS/CLI regressions from dependency bumps - #910
Open
kilisamemarisaaa wants to merge 5 commits into
Open
Conversation
glob v13 removed the callback API: glob(pattern, cb) now returns a promise and the callback never fires, so suite-runner silently ran zero tests and CI stayed green since the glob 11 -> 13 bump (fastify#852). Switch to async/await and fail loudly on glob errors. Co-Authored-By: EvoX <evox@evomap.ai>
Dependabot bumps moved several runtime deps to ESM-only releases that were never exercised because CI ran zero tests: - pkg-up@5 (ESM named exports): require() returned a namespace, breaking `fastify start` with 'pkgUp is not a function' - is-docker@4 (ESM default export): broke `fastify start` the same way - chalk@6 (ESM default export): broke generate/generate-plugin and watch Use named imports / .default interop at each require site. Co-Authored-By: EvoX <evox@evomap.ai>
The util.parseArgs migration (fastify#887) left two breakages that CI never caught because the test suite was silently no-op: - cli.js read argv._ which util.parseArgs values never contains; --help and <cmd> --help crashed with 'Cannot read properties of undefined' - generate-swagger --yaml was rejected by strict mode because yaml was not registered as a known option; register it in args.js (restores the lenient pre-migration behaviour) Co-Authored-By: EvoX <evox@evomap.ai>
…des it
Object.assign(pkg.tstyche || {}, template.tstyche) emitted an empty
'tstyche': {} into generated plugin package.json because the plugin
template has no tstyche section (regression from the tsd -> tstyche
migration, fastify#886). Guard the assignment.
Co-Authored-By: EvoX <evox@evomap.ai>
Under TypeScript 6 the node:test / node:assert types in templates/app-ts(-esm) tests no longer resolve (fastify-tsconfig does not set a 'types' field and @types/node is not picked up automatically), failing compilation with TS2591 — the first time these suites actually ran since CI went hollow. Equivalent CLI flags compile with 7 errors without --types node and 0 with it. Co-Authored-By: EvoX <evox@evomap.ai>
This was referenced Aug 28, 2026
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 test suite has been silently running zero tests in CI since
globwas bumped 11 -> 13 (#852, Dec 2025):glob(pattern, cb)no longer accepts a callback (it returns a promise), sosuite-runner.jsnever executed any test file and every CI run stayed green on an empty suite. That hollow green covered four separate regressions introduced by dependency bumps/migrations, all of which this PR fixes.What was broken and why
suite-runner.jsran nothing —glob(pattern, cb)callback never fires with glob v13;run({ files: [] })passed instantly with exit code 0. Evidence: CI logs show every suite completing in ~0.1s with zero test output, andc8coverage only reportedsuite-runner.jsitself. Fix:await glob(pattern)inside an asyncmain(), failing loudly on glob errors.fastify startcrashed withTypeError: pkgUp is not a function—pkg-upbumped to v5 (chore: bump the dependencies group with 3 updates #896, ESM-only, named exports) whileutil.jsdidconst pkgUp = require('pkg-up'), receiving the module namespace. Fix:const { pkgUp } = require('pkg-up').fastify start/generate/watchcrashed withchalk.x is not a function—chalkbumped to v6 (chore: bump chalk from 4.1.2 to 6.0.0 in the dependencies group #908, ESM-only, default export) while six files didconst chalk = require('chalk'). Fix:require('chalk').defaultinlog.js,generate.js,generate-plugin.js,lib/watch/{fork,index,utils}.js.is-dockerv4 (same class of bug instart.js) is fixed the same way.CLI parsing broke after the
util.parseArgsmigration (Replace yargs-parser with Node.js built-in util.parseArgs #887) —cli.jsreadargv._whichutil.parseArgs().valuesnever contains, sofastify --helpandfastify <cmd> --helpthrewCannot read properties of undefined (reading 'splice'); andgenerate-swagger --yamlwas rejected by strict mode becauseyamlwas not a registered option. Fix: readparsed.positionals[0]for the help command, and registeryamlinargs.jsCLI options (restoring the lenient pre-migration behaviour).fastify generate-pluginemitted an empty"tstyche": {}into the generatedpackage.json—Object.assign(pkg.tstyche || {}, template.tstyche)withtemplate.tstyche === undefinedyields{}(regression from the tsd -> tstyche migration, refactor(types): migrate from tsd to tstyche #886). Fix: guard the assignment.None of 2–5 was visible to users of published versions (7.4.1/8.0.0 still pin
pkg-up@^3.1.0), and none was caught by CI because of 1.Verification
npm run lintpasses.test/**/*.test.jsnow actually executes — 75/83 pass. The 6 remaining failures are Windows-onlyEBUSY(rmdiron in-use temp/workdirs) and its knock-on effects (chdir leak, leftover generated workdir being globbed); they do not reproduce on Linux (rimraf retry semantics + Linux allows removing a cwd). I left them out of scope rather than masking them.Notes