Skip to content

[BUG] test/lib/publish.js fails if not ran from a git repo #3842

Closed

Description

@wraithgar

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

https://github.com/nodejs/node/pull/40319 cigtm failed cause of a quirk in the way our tests work. Because the snapshots are inside the cli repo itself, when we normally run them there is a gitHead. nodejs tests run the code in a state where there is no .git folder to find, so that attribute is missing and the tests fail.

These tests should be robust enough to handle either case, either deleting the attribute itself or hard setting it without the if statement.

Expected Behavior

No response

Steps To Reproduce

No response

Environment

  • Node: 16.11.0 release candidate
  • npm: 7.24.2

Activity

  1. added
    Release 7.xwork is associated with a specific npm 7 release
    Bugthing that needs fixing
    Needs Triageneeds review for next steps
    on Oct 6, 2021
  2. self-assigned this
    on Oct 6, 2021
  3. targos commented on Oct 6, 2021

    @targos
    Contributor

    It's also possible to configure CITGM to use a git checkout for npm (the feature exists already)

  4. wraithgar commented on Oct 6, 2021

    @wraithgar
    ContributorAuthor

    It's also possible to configure CITGM to use a git checkout for npm (the feature exists already)

    That would get your citgm unblocked but this really should be a test that is robust enough to work in this case. The publish tests aren't the place where we are even checking if the gitHead is set properly when reading a package, they should be discarded imo.

    npm8 is the only thing going out this week but I'll get a pr ready and this should be remediated by next week's npm release.

  5. ruyadorno commented on Jan 25, 2022

    @ruyadorno
    Contributor

    it looks like this was fixed, thanks @wraithgar 😊

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

Metadata

Metadata

Assignees

Labels

Bugthing that needs fixingRelease 7.xwork is associated with a specific npm 7 release

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions