@@ -58,6 +58,7 @@ void describe('hosting', () => {
58
58
let branchName : string ;
59
59
let commitSha : string ;
60
60
let executionRoleArn : string ;
61
+ let jobId : string | undefined ;
61
62
62
63
before ( async ( ) => {
63
64
assert . ok (
@@ -81,6 +82,24 @@ void describe('hosting', () => {
81
82
} ) ;
82
83
83
84
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
+
84
103
// Disconnect a branch if we're not on 'main' eagerly.
85
104
// So that we try to not leave garbage and hit 50 branches per app limit.
86
105
// The trade-offs considered here are:
@@ -112,6 +131,7 @@ void describe('hosting', () => {
112
131
branchName ,
113
132
commitSha ,
114
133
) ;
134
+ jobId = deploymentJob . jobId ;
115
135
if ( deploymentJob . status !== JobStatus . SUCCEED ) {
116
136
assert . ok ( deploymentJob . jobId ) ;
117
137
await waitForSuccessfulJobCompletion (
@@ -374,8 +394,6 @@ backend:
374
394
phases:
375
395
build:
376
396
commands:
377
- # TODO remove node install when Hosting rolls new image.
378
- - nvm install 18
379
397
# Uninstall Gen1 CLI, otherwise npm link below has a conflict on amplify binary
380
398
- npm uninstall -g @aws-amplify/cli
381
399
- npm ci --cache .npm --prefer-offline
0 commit comments