Skip to content

Commit 0ef9184

Browse files
authored
Remove Node version workaround from hosting test. Add logs. (#2733)
1 parent e0450d1 commit 0ef9184

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

.changeset/cold-tables-deny.md

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---

packages/integration-tests/src/test-e2e/hosting.test.ts

+20-2
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ void describe('hosting', () => {
5858
let branchName: string;
5959
let commitSha: string;
6060
let executionRoleArn: string;
61+
let jobId: string | undefined;
6162

6263
before(async () => {
6364
assert.ok(
@@ -81,6 +82,24 @@ void describe('hosting', () => {
8182
});
8283

8384
after(async () => {
85+
// Print logs
86+
if (jobId) {
87+
const getJobResult = await amplifyClient.send(
88+
new GetJobCommand({
89+
appId,
90+
branchName,
91+
jobId,
92+
}),
93+
);
94+
for (const step of getJobResult.job?.steps ?? []) {
95+
// Steps have pre-signed URLs.
96+
if (step.logUrl) {
97+
const logResponse = await fetch(step.logUrl);
98+
console.log(await logResponse.text());
99+
}
100+
}
101+
}
102+
84103
// Disconnect a branch if we're not on 'main' eagerly.
85104
// So that we try to not leave garbage and hit 50 branches per app limit.
86105
// The trade-offs considered here are:
@@ -112,6 +131,7 @@ void describe('hosting', () => {
112131
branchName,
113132
commitSha,
114133
);
134+
jobId = deploymentJob.jobId;
115135
if (deploymentJob.status !== JobStatus.SUCCEED) {
116136
assert.ok(deploymentJob.jobId);
117137
await waitForSuccessfulJobCompletion(
@@ -374,8 +394,6 @@ backend:
374394
phases:
375395
build:
376396
commands:
377-
# TODO remove node install when Hosting rolls new image.
378-
- nvm install 18
379397
# Uninstall Gen1 CLI, otherwise npm link below has a conflict on amplify binary
380398
- npm uninstall -g @aws-amplify/cli
381399
- npm ci --cache .npm --prefer-offline

0 commit comments

Comments
 (0)