Skip to content

@babel/core internal test skips fail when citgm run locally #1194

Open

Description

@MikeMcC399

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 total

In Node.js Jenkins CI citgm-smoker sets:

temp="$NODE_TEST_DIR"/citgm_tmp

This 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

citgm/lib/lookup.json

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:

citgm/lib/lookup.json

Lines 229 to 235 in 37e1545

"jose": {
"maintainers": ["panva"],
"prefix": "v",
"scripts": ["test", "tap:node"],
"envVar": { "CITGM": true },
"skip": ["<20", "win32"]
},

cc: @nicolo-ribaudo @JLHwung @liuxingbaoyu

Activity

  1. MikeMcC399 commented on Oct 13, 2026

    @MikeMcC399
    ContributorAuthor

    For comparison, if the temp directory is set to what @babel/core is looking for, then the tests succeed:

    $ citgm --tmpDir /tmp/citgm_tmp @babel/core
    info: starting            | @babel/core         
    info: lookup              | @babel/core         
    info: lookup-found        | @babel/core         
    info: @babel/core lookup-replace| https://github.com/babel/babel/archive/v8.0.7.tar.gz
    info: @babel/core yarn:   | Downloading project: https://github.com/babel/babel/archive/v8.0.7.tar.gz
    info: @babel/core npm:    | Project downloaded v8.0.7.tar.gz
    info: @babel/core yarn:   | yarn install started
    info: @babel/core yarn:   | yarn install successfully completed
    info: @babel/core yarn:   | test suite started  
    info: passing module(s)   |                     
    info: module name:        | @babel/core         
    info: version:            | 8.0.7               
    info: done                | The smoke test has passed.
    info: duration            | test duration: 123186ms

    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:

    $ citgm --tmpDir $(mktemp -d) @babel/core
    info: starting            | @babel/core         
    info: lookup              | @babel/core         
    info: lookup-found        | @babel/core         
    info: @babel/core lookup-replace| https://github.com/babel/babel/archive/v8.0.7.tar.gz
    info: @babel/core yarn:   | Downloading project: https://github.com/babel/babel/archive/v8.0.7.tar.gz
    info: @babel/core npm:    | Project downloaded v8.0.7.tar.gz
    info: @babel/core yarn:   | yarn install started
    info: @babel/core yarn:   | yarn install successfully completed
    info: @babel/core yarn:   | test suite started  
    error: failure             | The canary is dead: 
    error: failing module(s)   |                     
    error: module name:        | @babel/core         
    error: version:            | 8.0.7               
    error: error:              | The canary is dead: 
    ...
  2. liuxingbaoyu commented on Oct 13, 2026

    @liuxingbaoyu
    Contributor

    Thanks for the investigation!
    I'll open a PR. Do you think we need to keep the old logic for the transition period?

  3. MikeMcC399 commented on Oct 14, 2026

    @MikeMcC399
    ContributorAuthor

    @liuxingbaoyu

    Thanks for the investigation!

    You're welcome!

    I'll open a PR. Do you think we need to keep the old logic for the transition period?
    

    If you agree with the suggestion, then this would need 2 PRs:

    1. PR to add environments variable to

      citgm/lib/lookup.json

      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"]
      },
      That would need to be approved, merged and then be part of a citgm release before it could be used generally.
    2. After the citgm environment variable is available, then create a PR to @babel/core to use the new environment variable

    The old logic should be kept until there is a new release of citgm.

  4. MikeMcC399 commented on Oct 20, 2026

    @MikeMcC399
    ContributorAuthor

    @liuxingbaoyu

    Have you taken any action to open PRs as you said that you planned to do?

  5. liuxingbaoyu commented on Oct 21, 2026

    @liuxingbaoyu
    Contributor

    Oh, thanks for reminding me. I'm going to open a PR.

  6. MikeMcC399 commented on Oct 23, 2026

    @MikeMcC399
    ContributorAuthor

    I checked the changes and they are working in a test environment.

    It now needs #1213 to be approved and merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions