Skip to content

CJS: ignore impacted JS runs when no matching test files exist#38339

Merged
pelikhan merged 1 commit into
mainfrom
copilot/create-pr-ignore-run-no-test-found
Jun 10, 2026
Merged

CJS: ignore impacted JS runs when no matching test files exist#38339
pelikhan merged 1 commit into
mainfrom
copilot/create-pr-ignore-run-no-test-found

Conversation

Copilot AI commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Impacted JS CI currently fails when a changed source file is passed to Vitest as a filter but no *.test.{js,cjs} file matches, causing a non-actionable red run. This PR makes that path non-failing while preserving normal test execution when matches exist.

  • Problem surface

    • make test-impacted-js pipes changed JS/TS paths into npm run test:js ....
    • For non-test files (for example ai_credits_context.cjs), Vitest exits with code 1 (No test files found), failing the workflow.
  • Change

    • Updated the impacted-test invocation in Makefile to pass Vitest’s no-test tolerance flag.
    • Scope is limited to the impacted JS target; full JS test jobs are unchanged.
  • Behavioral effect

    • No matching tests for changed files now exit cleanly.
    • Matching tests still run and fail/pass normally.
cd actions/setup/js && printf '%s\n' "$$CHANGED_JS_FILES" | sed 's|^actions/setup/js/||' | tr '\n' '\0' | xargs -0 -r npm run test:js -- --no-file-parallelism --passWithNoTests $(JS_IMPACTED_TEST_EXCLUDES)

Copilot AI changed the title fix: ignore impacted JS runs when no test files match CJS: ignore impacted JS runs when no matching test files exist Jun 10, 2026
Copilot AI requested a review from pelikhan June 10, 2026 11:26
@pelikhan pelikhan marked this pull request as ready for review June 10, 2026 11:33
Copilot AI review requested due to automatic review settings June 10, 2026 11:33
@pelikhan pelikhan merged commit c6457ac into main Jun 10, 2026
@pelikhan pelikhan deleted the copilot/create-pr-ignore-run-no-test-found branch June 10, 2026 11:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts the test-impacted-js Makefile target so impacted JavaScript runs don’t fail when the changed-file filter results in no matching test files, avoiding non-actionable CI failures while keeping normal test execution behavior when matches exist.

Changes:

  • Added Vitest’s --passWithNoTests flag to the impacted JS test invocation.
  • Kept the full JS test target unchanged (make test-js still runs as before).
Show a summary per file
File Description
Makefile Updates the impacted JS test command to tolerate “no test files found” when filtering by changed paths.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 1/1 changed files
  • Comments generated: 0

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.

3 participants