Skip to content

test(amplify-category-api-e2e-core): ensure Gen1 placeholder app + improve harness failure logging - #3499

Merged
sarayev merged 1 commit into
release-api-plugin-stablefrom
gen1/e2e-placeholder-and-logging
Jun 26, 2026
Merged

test(amplify-category-api-e2e-core): ensure Gen1 placeholder app + improve harness failure logging#3499
sarayev merged 1 commit into
release-api-plugin-stablefrom
gen1/e2e-placeholder-and-logging

Conversation

@sarayev

@sarayev sarayev commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Description

Two Gen1 e2e harness improvements in amplify-e2e-core.

Ensure Gen1 placeholder app before amplify init

Adds an idempotent, best-effort run-start step that guarantees the Gen1 deprecation-bypass placeholder app (DoNotDeleteAppToBypassGen1Deprecation) and its test backend environment exist in each e2e shard's account + region before any amplify init runs. 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 paginates ListApps, creates the app via CreateApp only when missing, and creates the test environment 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 (and its native node-pty dependency).

Improve harness failure logging

initJSProjectWithProfile now emits an explicit initJSProjectWithProfile SUCCESS / FAILED: <err> instead of the misleading unconditional Result of initJSProjectWithProfile: null on 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

tsc of amplify-e2e-core passes. Logging changes are diagnostic-only with no behavior change.

Split out from #3494 (PR-6 of the full split).

…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.
@Simone319

Copy link
Copy Markdown
Contributor

Why is #3499 and #3497 both implementing the ensureGen1PlaceholderApp? Look like they are merging into 2 different branches. Is there any mechanism to keep the branches in sync?

@sarayev
sarayev merged commit 2f62dbe into release-api-plugin-stable Jun 26, 2026
6 of 7 checks passed
@sarayev
sarayev deleted the gen1/e2e-placeholder-and-logging branch June 26, 2026 14:09
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