Repository navigation
@babel/core internal test skips fail when citgm run locally #1194
Copy link
Copy link
Open
Description
Situation
When cigtm @babel/core is run outside of Node.js Jenkins CI, it fails to skip tests that it intended to skip for citgm.
error: |
error: | Summary of all failing tests
error: | FAIL packages/babel-traverse/test/traverse.js
error: | traverse > traverse.explode > deprecated types and aliases > should warn for deprecated node types
error: | Error: expect(jest.fn()).toHaveBeenCalledWith(...expected)
error: |
error: | Expected: StringMatching /Visitor `NumberLiteral` has been deprecated, please migrate to `NumericLiteral`[^]+at.+testFn1/
error: |
error: | Number of calls: 0
error: | at testFn1 (file:///tmp/be09bd18/@babel/core/packages/babel-traverse/test/traverse.js?1791788834095:513:30)
error: | at async file:///tmp/be09bd18/@babel/core/node_modules/tinypool/dist/esm/entry/worker.js:72:20
error: |
error: | traverse > traverse.explode > deprecated types and aliases > should warn for deprecated aliases
error: | Error: expect(jest.fn()).toHaveBeenCalledWith(...expected)
error: |
error: | Expected: StringMatching /Visitor `ModuleDeclaration` has been deprecated, please migrate to `ImportOrExportDeclaration`[^]+at.+testFn2/
error: |
error: | Number of calls: 0
error: | at testFn2 (file:///tmp/be09bd18/@babel/core/packages/babel-traverse/test/traverse.js?1791788834095:529:30)
error: | at async file:///tmp/be09bd18/@babel/core/node_modules/tinypool/dist/esm/entry/worker.js:72:20
error: |
error: |
error: | Test Suites: 1 failed, 275 passed, 276 total
error: | Tests: 2 failed, 16 skipped, 36969 passed, 36987 totalIn Node.js Jenkins CI citgm-smoker sets:
temp="$NODE_TEST_DIR"/citgm_tmpThis is however not generally the case if citgm is run in GitHub Actions or on a local system.
In the above example from Ubuntu on GitHub Actions the temp directory is /tmp/be09bd18 and the tests are not skipped.
Suggestion
Add an environment variable CITGM set to true into
Lines 2 to 8 in 37e1545
| "@babel/core": { | |
| "maintainers": ["nicolo-ribaudo", "JLHwung", "liuxingbaoyu"], | |
| "prefix": "v", | |
| "yarn": true, | |
| "scripts": ["build", "test-only"], | |
| "skip": ["aix", "ppc", "s390", "win32"] | |
| }, |
and skip tests in @babel/core based on this environment variable as necessary.
This is used by jose, for example:
Lines 229 to 235 in 37e1545
| "jose": { | |
| "maintainers": ["panva"], | |
| "prefix": "v", | |
| "scripts": ["test", "tap:node"], | |
| "envVar": { "CITGM": true }, | |
| "skip": ["<20", "win32"] | |
| }, |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
MikeMcC399 commentedon Oct 13, 2026
For comparison, if the temp directory is set to what @babel/core is looking for, then the tests succeed:
The name of the temp directory should not be used to determine whether tests are running in citgm or not. Using a different temp directory causes citgm to fail:
liuxingbaoyu commentedon Oct 13, 2026
Thanks for the investigation!
I'll open a PR. Do you think we need to keep the old logic for the transition period?
MikeMcC399 commentedon Oct 14, 2026
@liuxingbaoyu
You're welcome!
If you agree with the suggestion, then this would need 2 PRs:
citgm/lib/lookup.json
Lines 2 to 8 in 37e1545
@babel/coreto use the new environment variableThe old logic should be kept until there is a new release of citgm.
MikeMcC399 commentedon Oct 20, 2026
@liuxingbaoyu
Have you taken any action to open PRs as you said that you planned to do?
liuxingbaoyu commentedon Oct 21, 2026
Oh, thanks for reminding me. I'm going to open a PR.
MikeMcC399 commentedon Oct 23, 2026
I checked the changes and they are working in a test environment.
It now needs #1213 to be approved and merged.