Skip to content

chore: skip e2e tests for docs-only and ignorable-file PRs#7704

Merged
ashishjain0512 merged 3 commits into
developfrom
chore/e2e-scope-skip-ignorable-files
May 4, 2026
Merged

chore: skip e2e tests for docs-only and ignorable-file PRs#7704
ashishjain0512 merged 3 commits into
developfrom
chore/e2e-scope-skip-ignorable-files

Conversation

@ashishjain0512
Copy link
Copy Markdown
Collaborator

@ashishjain0512 ashishjain0512 commented May 4, 2026

Summary

Extends the e2e scope detection script (scripts/e2e-diagram-scope.mjs) to recognize ignorable files — files that can never affect rendered diagram output. When a PR touches only ignorable files (docs, changesets, AI config, etc.), the entire e2e job is now skipped instead of running the full 5-container Cypress suite.

This builds on the diagram-scoped e2e optimization from #7619.

Changes

scripts/e2e-diagram-scope.mjs

  • Added IGNORABLE_PREFIXES list covering: docs source/generated, .changeset/, .claude/, assistant/, docs CI workflows, doc scripts
  • Added IGNORABLE_SUFFIXES (.md files at repo root) with a guard to exclude .md files inside diagram source folders
  • Added SKIP sentinel return value (exported) when all changed files are ignorable
  • Ignorable files get continue (skipped) instead of break (triggering full suite)

.github/workflows/e2e.yml

  • detect-scope step now handles the SKIP output value
  • e2e job has an if: condition to skip entirely when SKIP is returned

scripts/run-e2e-scoped.ts

  • Local runner handles SKIP with early exit and clear message

scripts/e2e-diagram-scope.spec.ts

  • 9 new test cases covering: docs-only, root markdown, changesets, generated docs, AI config, docs CI workflows, mixed (docs + diagram), mixed (docs + shared code), non-docs CI

package.json

  • Pinned @argos-ci/cypress to ^6.2.12 for ARGOS_SUBSET support (minimum version with this feature). Versions 6.3.x have a packaging bug where exports maps point to dist/task.js but the package ships dist/task.mjs instead, causing Cannot find module errors in CI.

.cspell/code-terms.txt

  • Added CODEOWNERS to the spell-check dictionary

Detection behavior matrix

PR changes Result e2e behavior
Only docs/changesets/AI config SKIP Job skipped entirely
Diagram source + docs Scoped pattern Scoped run (diagram specs only)
Shared code + docs "" Full suite
Only diagram source Scoped pattern Scoped run
Unknown/root files (package.json, CI) "" Full suite (conservative)

Tests

All 25 tests pass (including 9 new ignorable-file tests).

Add IGNORABLE_PREFIXES and IGNORABLE_SUFFIXES to the e2e scope detection
script so that PRs touching only documentation, changesets, AI config, or
other non-rendering files skip e2e entirely instead of triggering the full
5-container Cypress suite.

Changes:
- Add SKIP sentinel return value to detectScope() for ignorable-only PRs
- Add ignorable file detection (docs, changesets, .claude/, assistant/, etc.)
- Update e2e.yml workflow to skip the e2e job when SKIP is returned
- Update local runner (run-e2e-scoped.ts) to handle SKIP
- Upgrade @argos-ci/cypress to ^6.3.3 for ARGOS_SUBSET support
- Add 9 new test cases covering docs-only, mixed, and skip scenarios
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 4, 2026

⚠️ No Changeset found

Latest commit: 0cb8cc8

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@netlify
Copy link
Copy Markdown

netlify Bot commented May 4, 2026

Deploy Preview for mermaid-js ready!

Name Link
🔨 Latest commit 0cb8cc8
🔍 Latest deploy log https://app.netlify.com/projects/mermaid-js/deploys/69f877eaf64e650008d574a6
😎 Deploy Preview https://deploy-preview-7704--mermaid-js.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions Bot added the Type: Other Not an enhancement or a bug label May 4, 2026
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 4, 2026

Open in StackBlitz

@mermaid-js/examples

npm i https://pkg.pr.new/@mermaid-js/examples@7704

mermaid

npm i https://pkg.pr.new/mermaid@7704

@mermaid-js/layout-elk

npm i https://pkg.pr.new/@mermaid-js/layout-elk@7704

@mermaid-js/layout-tidy-tree

npm i https://pkg.pr.new/@mermaid-js/layout-tidy-tree@7704

@mermaid-js/mermaid-zenuml

npm i https://pkg.pr.new/@mermaid-js/mermaid-zenuml@7704

@mermaid-js/parser

npm i https://pkg.pr.new/@mermaid-js/parser@7704

@mermaid-js/tiny

npm i https://pkg.pr.new/@mermaid-js/tiny@7704

commit: 0cb8cc8

@codecov
Copy link
Copy Markdown

codecov Bot commented May 4, 2026

Codecov Report

❌ Patch coverage is 0% with 50 lines in your changes missing coverage. Please review.
✅ Project coverage is 3.33%. Comparing base (84abc58) to head (0cb8cc8).
⚠️ Report is 24 commits behind head on develop.

Files with missing lines Patch % Lines
scripts/e2e-diagram-scope.mjs 0.00% 45 Missing ⚠️
scripts/run-e2e-scoped.ts 0.00% 5 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           develop   #7704      +/-   ##
==========================================
- Coverage     3.33%   3.33%   -0.01%     
==========================================
  Files          542     542              
  Lines        56881   56928      +47     
  Branches       839     839              
==========================================
  Hits          1899    1899              
- Misses       54982   55029      +47     
Flag Coverage Δ
unit 3.33% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
scripts/run-e2e-scoped.ts 4.00% <0.00%> (-0.77%) ⬇️
scripts/e2e-diagram-scope.mjs 0.00% <0.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Versions 6.3.x have a packaging bug where the exports map points to
dist/task.js but the package ships dist/task.mjs instead, causing
'Cannot find module' errors in CI. Version 6.2.12 is the minimum
version supporting ARGOS_SUBSET and ships the correct dist/task.js file.
@ashishjain0512 ashishjain0512 marked this pull request as ready for review May 4, 2026 10:43
@ashishjain0512 ashishjain0512 requested a review from knsv May 4, 2026 10:45
Copy link
Copy Markdown
Collaborator

@knsv knsv left a comment

Choose a reason for hiding this comment

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

👍

@argos-ci
Copy link
Copy Markdown

argos-ci Bot commented May 4, 2026

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) 👍 Changes approved 3 changed May 4, 2026, 10:55 AM

@ashishjain0512 ashishjain0512 merged commit 36ef39e into develop May 4, 2026
31 checks passed
@ashishjain0512 ashishjain0512 deleted the chore/e2e-scope-skip-ignorable-files branch May 4, 2026 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Other Not an enhancement or a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants