Skip to content

Conversation

@Amplifiyer
Copy link
Contributor

@Amplifiyer Amplifiyer commented Sep 16, 2024

Problem

We currently don't have tests to validate that changes in amplify outputs versioning will not break apps built with older versions.

Issue number, if available:

Changes

add new e2e test for validating backwards compatibility of amplify outputs.

  1. Check that app built with older version can now have it's outputs generated with the new version proposed.
  2. Check that app built with new version proposed can now have it's outputs generated with the older version of the library.

Corresponding docs PR, if applicable:

Validation

Checklist

  • If this PR includes a functional change to the runtime behavior of the code, I have added or updated automated test coverage for this change.
  • If this PR requires a change to the Project Architecture README, I have included that update in this PR.
  • If this PR requires a docs update, I have linked to that docs PR above.
  • If this PR modifies E2E tests, makes changes to resource provisioning, or makes SDK calls, I have run the PR checks with the run-e2e label set.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@Amplifiyer Amplifiyer added the run-e2e Label that will include e2e tests in PR checks workflow label Sep 16, 2024
@changeset-bot
Copy link

changeset-bot bot commented Sep 16, 2024

🦋 Changeset detected

Latest commit: 07c7501

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@Amplifiyer Amplifiyer marked this pull request as ready for review September 17, 2024 14:30
@Amplifiyer Amplifiyer requested review from a team as code owners September 17, 2024 14:30
await currentNpmProxyController.tearDown();
await baselineNpmProxyController.setUp();
await reinstallDependencies();
await execa(
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we also add code that calls generateClientConfig<> with all known versions ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added

Copy link
Contributor

@sobolk sobolk left a comment

Choose a reason for hiding this comment

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

Btw. Looks good overall.

Comment on lines +103 to +113
try {
assert.ok(
await generateClientConfig(branchBackendIdentifier, '1'),
`outputs v1 failed to be generated for an app created with ${type} library version`
);
} catch (e) {
throw new Error(
`outputs v1 failed to be generated for an app created with ${type} library version. Error: ${JSON.stringify(
e
)}`
);
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need these try-catch blocks ?

would assert.doesNotReject() work here ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it will, but the error messages were a bit cryptic. This way we can add more assertions on the result of the API as well in the future.

@Amplifiyer Amplifiyer merged commit 5af7781 into main Sep 17, 2024
@Amplifiyer Amplifiyer deleted the output_backwards_compat_test branch September 17, 2024 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-e2e Label that will include e2e tests in PR checks workflow

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants