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

feat(test-tools): Support lerna in assign-test-ports #23361

Closed
wants to merge 4 commits into from

Conversation

Abe27342
Copy link
Contributor

Description

Adjusts test-tools's assign-test-ports script to support using lerna over pnpm. This allows us to use a modern test-tools version in our LTS branch. See discussion on #23285.

@Copilot Copilot bot review requested due to automatic review settings December 18, 2024 20:48
@github-actions github-actions bot added the base: main PRs targeted against main branch label Dec 18, 2024

Choose a reason for hiding this comment

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

Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.

Files not reviewed (1)
  • tools/test-tools/package.json: Language not supported
@@ -1,5 +1,10 @@
#!/usr/bin/env node
const mod = require("../dist/assignTestPorts.js");
const nconf = require("nconf");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was going to keep test-tools dependency-less, but figured it's not much overhead to add nconf and we use it elsewhere in our test infra (e2e test scripts). Open to writing some minimal parsing logic ourselves if reviewer would prefer that though; we don't need a particularly reusable or ergonomic thing here.

Copy link
Contributor

Choose a reason for hiding this comment

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

When do dependencies for assign-test-ports get installed? Is there an existing use case where the dependencies are not installed?
I think using helper is good, but not confident this won't breaking existing workflows. :/

Copy link
Contributor Author

Choose a reason for hiding this comment

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

All of our usage of test-tools should just come via normal dep declaration in package.json, so transitive dependencies should be fine. e.g. see changes in https://github.com/microsoft/FluidFramework/pull/23285/files#diff-483384132d69f74744804315cbd004d361f840a7a007d9cfaca2714c69428493

Copy link
Contributor

Choose a reason for hiding this comment

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

+1, I think this won't be an issue. A bit related, I have another PR open to make test-tools a @fluid-private package in the client release group, so all its uses would be limited to it being a dev dependency during the build.

Copy link
Contributor

Choose a reason for hiding this comment

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

So, if test-tools is becoming private, then I don't think this makes sense to merge to main. Something needs to support the LTS branch. Can either the privatization also happen in LTS OR is there a test-tools release and development branch that this should accumulate to?

Copy link
Contributor

Choose a reason for hiding this comment

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

Fair. I'd propose test-tools 2.x as the one that keeps supporting LTS, so we could merge this to release/test-tools/2.0 instead of main, release 2.1.0, and have that be the (hopefully) final piece that fixes the LTS build. I don't expect that we'll need many changes to test-tools going forward for the sake of LTS, so I'd be ok doing all of it as patches/minors on top of that release branch.

Copy link
Contributor

Choose a reason for hiding this comment

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

I was implicitly thinking of adding this change to the test-tools 2.x release branch anyway in order to consume it from LTS, just hadn't thought that it indeed doesn't make much sense in main.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

All that sounds good to me--I've opened #23429 for the change directly into 2.x (after addressing other bit of PR feedback) and will close this one.

@Abe27342
Copy link
Contributor Author

Still working on testing this change in LTS locally.

@Abe27342
Copy link
Contributor Author

Update: my LTS branch doesn't repro the same port assignment error that originally motivated this change, but I have locally verified that:

  1. The script produces a reasonable port map file using both pnpm and lerna (on an lts branch)
  2. Script usage (e.g. help message) remains a reasonable experience
  3. Argument parsing looks correct

So I'm reasonably confident this change should be ok.

@alexvy86
Copy link
Contributor

doesn't repro the same port assignment error that originally motivated this change

Expected, the issue only happens in the build agents where something is listening on port 8084.

Copy link
Contributor

@alexvy86 alexvy86 left a comment

Choose a reason for hiding this comment

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

Functional changes look good to me. I think the only remaining question is if we even want to merge this to main, or directly to release/test-tools/2.0, since it's only relevant there (and there's the open PR I mentioned in one of the comments, making test-tools a private package that wouldn't be published going forward).

Abe27342 added a commit that referenced this pull request Jan 2, 2025
## Description

Adjusts test-tools's assign-test-ports script to support using lerna
over pnpm. This allows us to use a modern test-tools version in our LTS
branch. See discussion on #23285 and #23361 for more context.

---------

Co-authored-by: Abram Sanderson <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
base: main PRs targeted against main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants