[DRAFT] chore: drive acceptance skips from CircleCI context (CLI-1464)#6801
[DRAFT] chore: drive acceptance skips from CircleCI context (CLI-1464)#6801robertolopezlopez wants to merge 26 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. |
|
b5e2f0f to
e6fc6b2
Compare
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.
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.
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.
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.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| it('no TEST_SNYK_IGNORE_LIST: no stderr banner, base paths preserved', () => { | ||
| const warn = jest.spyOn(console, 'warn').mockImplementation(() => {}); | ||
| const createJestConfig = loadCreateJestConfig(undefined); | ||
| const cfg = createJestConfig({}); | ||
| expect(cfg.testPathIgnorePatterns).toContain('/node_modules/'); | ||
| expect(warn).not.toHaveBeenCalled(); | ||
| }); |
There was a problem hiding this comment.
This test seems a bit hard to reason about....
It calls loadCreateJestConfig with undefined and then from the flow it appears it should delete process.env.TEST_SNYK_IGNORE_LIST, but then at line 27 you are expecting it to contain '/node_modules/'. I guess it is related to line 16 return require('../../createJestConfig').createJestConfig as (?
It is not clear to read these tests, could you please try to improve this?
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>
…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
…r handling and cleanup steps
…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.
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.
…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.
Updated `acceptanceIt` to log a banner once and detailed warnings for each skipped test ID individually, improving test observability and debugging.
… TypeScript and Jest
…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.
… JavaScript configuration Reverts `createJestConfig` TypeScript implementation back to JavaScript for compatibility. Updates `ts-node` usage and module registration for scoped transpilation of test utilities.
Refactored `createJestConfig` and `acceptanceTestSkipById` to use a shared parser for processing environment-based test ignore lists. Improved validation and logging of invalid entries.
…fig` for ignore list handling
…ing matching Updated `createJestConfig` and `acceptanceTestSkipById` to use a shared parser for processing comma-separated environment lists as literal strings, removing RegExp validation. Added tests for stable ID string handling.
Split env mutation from module reload: explicit set/unset helpers and JSDoc for why jest.resetModules() runs before require, addressing review feedback on test readability. Co-authored-by: Cursor <cursoragent@cursor.com>
Added tests to verify handling of `TEST_SNYK_IGNORE_LIST` environment variable, ensuring proper merging of patterns into `testPathIgnorePatterns`. Includes cases for empty, single, and multiple comma-separated values.
c296623 to
6cab26b
Compare
Implements CLI-1464
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?