Skip to content

[DRAFT] chore: drive acceptance skips from CircleCI context (CLI-1464)#6801

Closed
robertolopezlopez wants to merge 26 commits into
mainfrom
feat/CLI-1464-jest-ignore-paths
Closed

[DRAFT] chore: drive acceptance skips from CircleCI context (CLI-1464)#6801
robertolopezlopez wants to merge 26 commits into
mainfrom
feat/CLI-1464-jest-ignore-paths

Conversation

@robertolopezlopez

@robertolopezlopez robertolopezlopez commented May 13, 2026

Copy link
Copy Markdown
Contributor

Implements CLI-1464

Pull Request Submission Checklist

  • Follows CONTRIBUTING guidelines
  • Commit messages
    are release-note ready, emphasizing
    what was changed, not how.
  • Includes detailed description of changes
  • Contains risk assessment (Low | Medium | High)
  • Highlights breaking API changes (if applicable)
  • Links to automated tests covering new functionality
  • Includes manual testing instructions (if necessary)
  • Updates relevant GitBook documentation (PR link: ___)
  • Includes product update to be announced in the next stable release notes

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?

@snyk-io

snyk-io Bot commented May 13, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@github-actions

github-actions Bot commented May 13, 2026

Copy link
Copy Markdown
Contributor
Warnings
⚠️

Since the CLI is unifying on a standard and improved tooling, we're starting to migrate old-style imports and exports to ES6 ones.
A file you've modified is using either module.exports or require(). If you can, please update them to ES6 import syntax and export syntax.
Files found:

  • .eslintrc.json
  • test/jest/acceptance/resilience.spec.ts
  • test/jest/acceptance/snyk-code/snyk-code-user-journey.spec.ts
⚠️ There are multiple commits on your branch, please squash them locally before merging!
⚠️

"chore: refactor handling of TEST_SNYK_SKIP_TEST_IDS for literal string matching" is too long. Keep the first line of your commit message under 72 characters.

⚠️

"chore: streamline variable naming and destructuring in createJestConfig for ignore list handling" is too long. Keep the first line of your commit message under 72 characters.

⚠️

"chore: revert TypeScript migration for createJestConfig and restore JavaScript configuration" is too long. Keep the first line of your commit message under 72 characters.

⚠️

"Revert "chore: refactor and modularize Jest ignore list and skip tests handling"" is too long. Keep the first line of your commit message under 72 characters.

⚠️

"chore: add missing dependencies to check-dependencies.config.ts for TypeScript and Jest" is too long. Keep the first line of your commit message under 72 characters.

⚠️

"chore: simplify destructuring in createJestConfig for testPathIgnorePatterns" is too long. Keep the first line of your commit message under 72 characters.

⚠️

"chore: migrate Jest configurations to TypeScript and reorganize createJestConfig" is too long. Keep the first line of your commit message under 72 characters.

⚠️

"chore: log skipped test IDs in acceptanceIt for improved test observability" is too long. Keep the first line of your commit message under 72 characters.

⚠️

"chore: remove TAP JUnit sanitation script and update observability logging in docs" is too long. Keep the first line of your commit message under 72 characters.

⚠️

"chore: migrate Jest configurations to TypeScript and enhance ignore fragment validation" is too long. Keep the first line of your commit message under 72 characters.

⚠️

"chore(circleci): simplify TAP test command by removing redundant error handling and cleanup steps" is too long. Keep the first line of your commit message under 72 characters.

⚠️

"chore(circleci): update yq installation path to $HOME/.local/bin and adjust PATH accordingly" is too long. Keep the first line of your commit message under 72 characters.

⚠️

"chore: add acceptanceIt to custom test block functions in ESLint config and remove redundant eslint-disable comments" is too long. Keep the first line of your commit message under 72 characters.

⚠️

"test: migrate createJestConfig tests to TypeScript and refine implementation" is too long. Keep the first line of your commit message under 72 characters.

Generated by 🚫 dangerJS against 6cab26b

@robertolopezlopez robertolopezlopez force-pushed the feat/CLI-1464-jest-ignore-paths branch from b5e2f0f to e6fc6b2 Compare May 13, 2026 10:56
@robertolopezlopez robertolopezlopez changed the title CLI-1464 ignore flaky acceptance tests from CircleCI context chore: drive acceptance skips from CircleCI context (CLI-1464) May 13, 2026
@robertolopezlopez robertolopezlopez marked this pull request as ready for review May 13, 2026 13:59
@robertolopezlopez robertolopezlopez requested review from a team as code owners May 13, 2026 13:59
@snyk-pr-review-bot

This comment has been minimized.

@snyk-pr-review-bot

This comment has been minimized.

@snyk-pr-review-bot

This comment has been minimized.

@snyk-pr-review-bot

This comment has been minimized.

@snyk-pr-review-bot

This comment has been minimized.

Comment thread test/jest/util/acceptanceTestSkipById.ts
@snyk-pr-review-bot

This comment has been minimized.

Comment thread test/jest/util/acceptanceTestSkipById.ts
Comment thread test/jest/util/acceptanceTestSkipById.ts Outdated
Comment thread test/jest/util/acceptanceTestSkipById.ts
Comment thread test/jest/util/acceptanceTestSkipById.ts
Comment thread test/createJestConfig.js Outdated
Comment thread test/createJestConfig.ts Outdated
@snyk-pr-review-bot

This comment has been minimized.

@snyk-pr-review-bot

This comment has been minimized.

@snyk-pr-review-bot

This comment has been minimized.

@snyk-pr-review-bot

This comment has been minimized.

@snyk-pr-review-bot

This comment has been minimized.

@snyk-pr-review-bot

This comment has been minimized.

@snyk-pr-review-bot

This comment has been minimized.

@snyk-pr-review-bot

This comment has been minimized.

Comment thread test/jest/unit/createJestConfig.spec.ts Outdated
Comment on lines +23 to +29
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();
});

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.

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?

@robertolopezlopez robertolopezlopez marked this pull request as draft May 21, 2026 11:18
robertolopezlopez and others added 26 commits May 22, 2026 12:14
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.
…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.
…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.
…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.
@robertolopezlopez robertolopezlopez force-pushed the feat/CLI-1464-jest-ignore-paths branch from c296623 to 6cab26b Compare May 22, 2026 10:14
@robertolopezlopez robertolopezlopez deleted the feat/CLI-1464-jest-ignore-paths branch May 22, 2026 10:21
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.

2 participants