chore: drive acceptance skips from CircleCI context (CLI-1464)#6801
chore: drive acceptance skips from CircleCI context (CLI-1464)#6801robertolopezlopez wants to merge 21 commits into
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
|
Operators can narrow or skip flaky acceptance coverage from CircleCI without skip commits: whole-file patterns via TEST_SNYK_IGNORE_LIST merged into Jest path ignores, and granular it() skips via TEST_SNYK_SKIP_TEST_IDS with acceptanceIt() stable ids. CONTRIBUTING documents the workflow; acceptance-tests jobs attach team-cli-workflow-context so those variables are available in CI. Co-authored-by: Cursor <cursoragent@cursor.com>
b5e2f0f to
e6fc6b2
Compare
…nfig and remove redundant eslint-disable comments
Introduce a script to strip `<properties>` blocks from TAP's JUnit output, resolving parsing issues in CircleCI. Update `.circleci/config.yml` to invoke this script post-tests if output exists.
…and adjust `PATH` accordingly
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…r handling and cleanup steps
This comment has been minimized.
This comment has been minimized.
…ragment validation Refactored `createJestConfig` and associated project-level Jest configs to TypeScript. Improved handling of environment-based ignore fragments by validating RegExp sources, skipping invalid entries, and logging detailed warnings for observability. Updated tests and documentation to reflect changes.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| const ids = raw | ||
| .split(',') | ||
| .map((s) => s.trim()) | ||
| .filter(Boolean); | ||
| cachedSkipIds = new Set(ids); |
There was a problem hiding this comment.
is it possible in this flow for raw to be null, undefined or something like that?
| const raw = process.env.TEST_SNYK_SKIP_TEST_IDS; | ||
| if (typeof raw !== 'string' || raw.trim() === '') { | ||
| cachedSkipIds = new Set(); | ||
| return cachedSkipIds; | ||
| } | ||
|
|
||
| const ids = raw | ||
| .split(',') | ||
| .map((s) => s.trim()) | ||
| .filter(Boolean); | ||
| cachedSkipIds = new Set(ids); |
There was a problem hiding this comment.
I think you should use parseSnykIgnoreFragments from test/createJestConfig.js
| const { valid: snykFragments, invalid: invalidIgnoreFragments } = | ||
| partitionIgnoreFragments(parsedFragments); |
There was a problem hiding this comment.
why renaming valid and invalid to these names snykFragments and invalidIgnoreFragments?
I'd suggest using a single name also in the function to be clear, and avoid renaming
| const { testPathIgnorePatterns: configTestPathIgnores, ...restConfig } = | ||
| config; | ||
| const extraPathIgnores = Array.isArray(configTestPathIgnores) | ||
| ? configTestPathIgnores | ||
| : []; |
There was a problem hiding this comment.
no need to rename here either
There was a problem hiding this comment.
I simplified this, please let me know if this was what you intended
Extracted `getSkipTestList` and `getSkipTestIds` utilities for processing environment-based test ignore and skip lists into standalone modules. Updated `createJestConfig` and associated files to use these utilities for improved validation, modularity, and readability. Added unit tests for new utilities.
This comment has been minimized.
This comment has been minimized.
…teJestConfig` Converted project-level Jest configs and `createJestConfig` to TypeScript for consistency. Moved helper utilities like `getSkipTestList` for better modularity. No functional changes, improved type safety and maintainability.
This comment has been minimized.
This comment has been minimized.
Updated `acceptanceIt` to log a banner once and detailed warnings for each skipped test ID individually, improving test observability and debugging.
This comment has been minimized.
This comment has been minimized.
… TypeScript and Jest
This comment has been minimized.
This comment has been minimized.
…s handling" This reverts commit e204326. Revert "chore: migrate Jest configurations to TypeScript and reorganize `createJestConfig`" This reverts commit f4681f0. Revert "chore: enhance `acceptanceIt` logging for skipped test IDs" This reverts commit e6095ef. Revert "chore: simplify destructuring in `createJestConfig` for `testPathIgnorePatterns`" This reverts commit 36a5dd0. Revert "chore: add missing dependencies to `check-dependencies.config.ts` for TypeScript and Jest" This reverts commit 3b209b7.
This comment has been minimized.
This comment has been minimized.
… JavaScript configuration Reverts `createJestConfig` TypeScript implementation back to JavaScript for compatibility. Updates `ts-node` usage and module registration for scoped transpilation of test utilities.
PR Reviewer Guide 🔍
|
Pull Request Submission Checklist
are release-note ready, emphasizing
what was changed, not how.
What does this PR do?
Where should the reviewer start?
How should this be manually tested?
What's the product update that needs to be communicated to CLI users?