ci: run lint and unit tests on pull requests - #154
Merged
Merged
Conversation
None of the pull_request-triggered workflows actually run the root Jest suite (npm run test:unit) — only the TestCafe e2e suite in e2e-local-dist.yml runs on PRs. npm-publish-manual.yml and npm-prerelease-nightly.yml reference npm run test, but only fire on workflow_dispatch/schedule, never on a PR. Practical effect: unit test files (e.g. Extensible.test.tsx) can be broken or deleted by a PR with no automated signal catching it before merge. Add a workflow that runs npm run lint + npm run test:unit on every PR touching packages/**. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The path filter only matched packages/**, so this workflow never ran on the PR that introduced it (#154) -- confirmed via gh pr checks, only CLA and Kodiak fired. Add the workflow's own path so future edits to it (including this one) are validated. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Jest/ts-jest resolves the workspace packages (@adobe/uix-host, @adobe/uix-core, etc.) through their built dist/ output, not their TS source. Without a build step first, every test file that imports across packages fails with TS2307 "Cannot find module" on a clean checkout. Reproduced in a scratch clone with only `npm ci`: 6 of 15 suites failed this way. Confirmed `npm run build` before `npm run test:unit` fixes it -- 15/15 passing from a clean checkout. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
Description
Adds a
pull_request-triggered workflow that runsnpm run lintandnpm run test:unit(the root Jest suite acrossuix-core/uix-host/uix-host-react).Motivation and Context
Found while reviewing #152: none of the
pull_request/push-triggered workflows in this repo actually run the root Jest suite.e2e-local-dist.ymlruns onpull_request, but its test step (npm testinworking-directory: e2e/tests) runs the TestCafe e2e suite, not the root Jest config.npm-publish-manual.ymlandnpm-prerelease-nightly.ymlreferencenpm run test(lint +test:unit+ subtests), but only fire onworkflow_dispatch/schedule— never on a PR.e2e-all-versions.ymlisworkflow_dispatch-only.Practical effect: unit test files (e.g.
Extensible.test.tsx) can be broken, weakened, or deleted by a PR with zero automated signal catching it before merge — the only thing gating a PR today is the e2e suite and whatever the author happens to run locally.How Has This Been Tested?
Ran the exact commands the new job runs, against current
main:npm run lint— passes (prettier format check + fixpack, no eslint step — matches the existinglintscript, unchanged here).npm run test:unit— 15 suites, 84 passed / 2 skipped, 0 failing.Types of changes
Checklist
🤖 Generated with Claude Code