test(amplify-category-api-e2e-core): ensure Gen1 placeholder app + improve harness failure logging - #3499
Merged
sarayev merged 1 commit intoJun 26, 2026
Conversation
…prove harness failure logging Two Gen1 e2e harness improvements in amplify-e2e-core. Ensure Gen1 placeholder app before init: add an idempotent, best-effort run-start step that guarantees the Gen1 deprecation-bypass placeholder app (DoNotDeleteAppToBypassGen1Deprecation) and its 'test' backend environment exist in each shard's account + region before any `amplify init` runs, so the Gen1 end-of-life gate never blocks the suite and any prior cleanup-deletion is self-healed. The new ensureGen1PlaceholderApp(region) helper uses @aws-sdk/client-amplify: it paginates ListApps, creates the app via CreateApp only when missing, and creates the 'test' env via CreateBackendEnvironment only when ListBackendEnvironments shows it absent. It defaults region to process.env.CLI_REGION, relies on the ambient e2e credentials, and swallows/logs all errors so a healthy run is never broken. It is wired as a Jest globalSetup hook in both Gen1 e2e packages (amplify-e2e-tests and graphql-transformers-e2e-tests) so it runs once per shard, via standalone modules that avoid the heavy e2e-core barrel. Improve harness failure logging: initJSProjectWithProfile now emits an explicit "initJSProjectWithProfile SUCCESS" / "FAILED: <err>" instead of the misleading unconditional "...: null" on success. The nspawn run() exit handler now dumps the full captured output and the signal alongside the exit code on a non-zero exit, instead of only the last 10 lines (lastScreen) which could be empty and hid the real error. tsc of amplify-e2e-core passes.
Contributor
Simone319
approved these changes
Jun 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Two Gen1 e2e harness improvements in
amplify-e2e-core.Ensure Gen1 placeholder app before
amplify initAdds an idempotent, best-effort run-start step that guarantees the Gen1 deprecation-bypass placeholder app (
DoNotDeleteAppToBypassGen1Deprecation) and itstestbackend environment exist in each e2e shard's account + region before anyamplify initruns. This self-heals the Gen1 end-of-life gate: if a prior run's cleanup deleted the placeholder app, the suite would otherwise be blocked.The new
ensureGen1PlaceholderApp(region)helper uses@aws-sdk/client-amplify: it paginatesListApps, creates the app viaCreateApponly when missing, and creates thetestenvironment viaCreateBackendEnvironmentonly whenListBackendEnvironmentsshows it absent. It defaults region toprocess.env.CLI_REGION, relies on the ambient e2e credentials, and swallows/logs all errors so a healthy run is never broken. It is wired as a JestglobalSetuphook in both Gen1 e2e packages (amplify-e2e-testsandgraphql-transformers-e2e-tests) so it runs once per shard, via standalone modules that avoid the heavy e2e-core barrel (and its nativenode-ptydependency).Improve harness failure logging
initJSProjectWithProfilenow emits an explicitinitJSProjectWithProfile SUCCESS/FAILED: <err>instead of the misleading unconditionalResult of initJSProjectWithProfile: nullon success.The nspawn
run()exit handler now dumps the full captured output plus the signal alongside the exit code on a non-zero exit, instead of only the last 10 lines (lastScreen) which could be empty for push/add-function failures and hid the real error. Timeout branches and the quiet success path are unchanged.Testing
tscofamplify-e2e-corepasses. Logging changes are diagnostic-only with no behavior change.Split out from #3494 (PR-6 of the full split).