Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node functional test improvements #9437

Merged
merged 7 commits into from
Nov 15, 2024
Merged

Conversation

fviernau
Copy link
Member

@fviernau fviernau commented Nov 15, 2024

Align the project-with-lockfile tests, and add support for parsing the authors in Yarn2 projects.

Part of #9261.

@fviernau fviernau requested a review from a team as a code owner November 15, 2024 10:03
@fviernau fviernau force-pushed the node-fun-test-improvements-iv branch from 6d9bb42 to 6b812b2 Compare November 15, 2024 10:36
@fviernau fviernau force-pushed the node-fun-test-improvements-iv branch from 6b812b2 to 9c12e33 Compare November 15, 2024 10:47
@fviernau fviernau enabled auto-merge (rebase) November 15, 2024 11:11
@@ -1,6 +1,6 @@
---
project:
id: "NPM::<REPLACE_PROJECT_NAME>:1.0.0"
id: "NPM::npm-package-lock:1.0.0"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not from the filename of the definition file.

True, but what's a bit unclear from just looking at this diff is that the callers actually do set REPLACE_PROJECT_NAME to something based on the definitionFile's name.

So maybe better say:

Callers set REPLACE_PROJECT_NAME to something based on the definitionFile's name, which is wrong here as the name of the identifier in the result comes from the string value of the name property within the package.json.

"resolve package-lock dependencies correctly" {
val definitionFile = getAssetFile("projects/synthetic/npm/package-lock/package.json")
val expectedResultFile = getAssetFile("projects/synthetic/npm/package-lock-expected-output.yml")
"resolve dependencies for a project with lockfile correctly" {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Maybe the commit message scope should be "npm" instead of "node" as a whole?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually true for other commits in this PR as well. Now that all Node PMs are separate, it could be beneficial to specify more narrow scopes named after the concrete PM.

"cheerio": "1.0.0-rc.1",
"long": "^3.2.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please explain in the commit message why these are reordered, and to which order. I guess to have alphabetical ordering, but why is that important here? Just for readability / consistency, or something else?

Maybe instead of "re-order" simply say "sort" to make things clearer?

@@ -2,6 +2,8 @@
project:
id: "PNPM::pnpm-package-with-lockfile:1.0.0"
definition_file_path: "<REPLACE_DEFINITION_FILE_PATH>"
authors:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit message typo in "comparision".

Callers set `REPLACE_PROJECT_NAME` to something based on the
`definitionFile`'s name, which is wrong here as the name of the
identifier in the result comes from the string value of the name
property within the package.json.

Signed-off-by: Frank Viernau <frank_viernau@epam.com>
Make the name consistent with similar projects for the other three node
package managers.

Signed-off-by: Frank Viernau <frank_viernau@epam.com>
Use alphabetical order for readability.

Signed-off-by: Frank Viernau <frank_viernau@epam.com>
Signed-off-by: Frank Viernau <frank_viernau@epam.com>
Align the dependencies of the `Yarn` and `pnpm` test projects with the
analog `Npm` one, using the respective `add` CLI command. This makes the
test results easier to compare.

Note: Doing this for `Yarn2` is not yet possible, because of
      #9436.

Signed-off-by: Frank Viernau <frank_viernau@epam.com>
Align the metadata with the one from `Npm` for a better comparison.

Signed-off-by: Frank Viernau <frank_viernau@epam.com>
Signed-off-by: Frank Viernau <frank_viernau@epam.com>
@fviernau fviernau force-pushed the node-fun-test-improvements-iv branch from 9c12e33 to 205bcf5 Compare November 15, 2024 11:45
@fviernau fviernau requested a review from sschuberth November 15, 2024 11:45
@fviernau fviernau merged commit 78303ed into main Nov 15, 2024
21 checks passed
@fviernau fviernau deleted the node-fun-test-improvements-iv branch November 15, 2024 12:05
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