Fix TypeScript template test discovery for optional runtime suite#39
Closed
Fix TypeScript template test discovery for optional runtime suite#39
Conversation
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.
Motivation
node --test, which causes Node to error when a glob matches nothing; the goal is to avoid failing CI in that case.runtime/testssuite should be optional for TypeScript template execution whiletypescript-sdk/testsmust remain required.Description
existsSync,readdirSync,path, andfileURLToPathintypescript-sdk/scripts/template-tests.mjs.{ dir, optional }and treatruntime/testsas optional andtypescript-sdk/testsas required.*.test.mjsfiles per-suite, skip optional suites when the directory is missing or empty, and fail fast when required suites or files are missing.node --test <file>and exit with the first non-zero status.Testing
cd typescript-sdk && npm run typecheck && npm run build && npm run test:unit; the run failed due to pre-existing TypeScript errors insrc/index.ts, unrelated to this script change.cd python-sdk && python -m ruff check . && python -m mypy commandlayer && python -m pytest tests/ -v; the run failed due to existing Python lint/type issues unrelated to this change.node scripts/parity-check.mjs; this failed becausetypescript-sdk/dist/index.cjswas missing when the TS build failed (expected given the TypeScript errors).node typescript-sdk/scripts/template-tests.mjsto validate discovery and skipping behavior; the runner now skips missing optional suites and executes discovered files, but the runtime tests that import the built TS package fail when the package is not built (as observed above).Codex Task