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

fix: Amplify test fails when CLI is installed from Verdaccio #55

Merged
merged 1 commit into from
Mar 10, 2025

Conversation

rix0rrr
Copy link
Contributor

@rix0rrr rix0rrr commented Mar 10, 2025

The Amplify tests (used to) work like this:

  • npm create amplify, which runs npx create-amplify
  • Update the package.json to point to the correct CLI version
  • npm install and run the Amplify CLI

However, during the first step (npx create-amplify) the Amplify CLI already picks a baked-in CLI version (let's say [email protected]) and npm installs it, before we have had a time to hack the package.json file.

This works fine if 2.1002.0 is available to install, but in the case where we have an isolated run with the candidate packages in Verdaccio, only the release candidate is available which will have a version like 2.1002.999, and the first step of this test fails.

What we do instead is download the installer and change the package version it is about to install by editing one of its data files, default_packages.json.

@rix0rrr rix0rrr requested a review from a team March 10, 2025 10:43
The Amplify tests (used to) work like this:

- `npm create amplify`, which runs `npx create-amplify`
- Update the `package.json` to point to the correct CLI version
- `npm install` and run the Amplify CLI

However, during the first step (`npx create-amplify`) the Amplify CLI
already picks a baked-in CLI version (let's say `[email protected]`) and
`npm install`s it, before we have had a time to hack the `package.json`
file.

This works fine if `2.1002.0` is available to install, but in the case
where we have an isolated run with the candidate packages in Verdaccio,
only the release candidate is available which will have a version like
`2.1002.999`, and the first step of this test fails.

What we do instead is download the installer and change the package
version it is about to install by editing one of its data files,
`default_packages.json`.
@rix0rrr rix0rrr force-pushed the huijbers/amplify-version branch from d62d2eb to 35550b5 Compare March 10, 2025 10:44
@rix0rrr rix0rrr temporarily deployed to integ-approval March 10, 2025 10:44 — with GitHub Actions Inactive
@aws-cdk-automation aws-cdk-automation added this pull request to the merge queue Mar 10, 2025
Merged via the queue into main with commit 6ebcb0d Mar 10, 2025
16 checks passed
@aws-cdk-automation aws-cdk-automation deleted the huijbers/amplify-version branch March 10, 2025 12:26
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.

3 participants