Skip to content

Conversation

@pose
Copy link
Contributor

@pose pose commented Nov 24, 2025

Part of pulumi/home#4417

While working on pulumi/pulumi-gcp#3460, I discovered that the version of @pulumi/pulumi-gcp used on the NodeJS tests was not the module under test: We were effectively testing against old versions of the library instead of using the NodeJS provider SDK release candidates.

I am adding a new opttest.Option boolean flag RequireYarnLinks that will gate the behavior of when YarnLinks have not been set. RequireYarnLinks has three possible values:

  • nil (or unset): Logs a warning if a NodeJS pulumi project does not specify at least one YarnLink.
  • true: Fail the test if there's not at least one YarnLink.
  • false: Suppress warning and silently ignore that there are no YarnLinks set. I am not sure if this would be immediately useful, but there may be some potential use case I don't know yet.

Moving forward, on the next pulumitest major version bump, we should make the RequireYarnLinks flag default to true: That would mean that test authors would need to explicitly opt-out from requiring at least one YarnLink.

While working on pulumi/pulumi-gcp#3460, I
discovered that the version of @pulumi/pulumi-gcp used on the NodeJS
tests was not the module under test. That meant we were effectively
testing against old versions of the library instead of using the NodeJS
release candidates.

I am adding a new `opttest.Option` boolean flag `RequireYarnLinks` that
will gate the behavior when YarnLinks have not been set.
`RequireYarnLinks` has three possible values:

 * `nil` (or unset): Logs a warning if a NodeJS pulumi project does not
   specify at least one `YarnLink`.
 * `true`: Fail the test if there's not at least one `YarnLink`.
 * `false`: Suppress warning and silently ignore that there are no
   `YarnLink`s set. I am not sure if this would be immediately useful,
   but there may be some potential use case I don't know yet.

Moving forward, on the next `pulumitest` major version bump, we should
make the `RequireYarnLinks` flag default to `true`: That would mean that
test authors would need to explicitly opt-out from requiring at least
one `YarnLink`.
@pose pose requested a review from a team November 24, 2025 15:44
@pose pose self-assigned this Nov 24, 2025
@pose pose requested a review from danielrbradley November 24, 2025 15:44
Copy link
Contributor

@Zaid-Ajaj Zaid-Ajaj left a comment

Choose a reason for hiding this comment

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

LGTM

@pose
Copy link
Contributor Author

pose commented Nov 26, 2025

Seems the failure was caused by the wrong versions used locally and on GHA. Thanks @Zaid-Ajaj for finding the problem 🙏 I am pinning the pulumi-random version to 4.18.4 to avoid this error.

@pose pose merged commit 78269b3 into main Nov 26, 2025
2 checks passed
@pose pose deleted the pose/features/add-warning-if-yarn-link-is-not-used-with-nodejs-runtime branch November 26, 2025 11:07
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