@@ -47,6 +47,12 @@ import { SQL_TESTS_USE_BETA } from './sql-e2e-config';
4747// to deal with bug in cognito-identity-js
4848( global as any ) . fetch = require ( 'node-fetch' ) ;
4949
50+ function logTimestamp ( message : string ) : void {
51+ const date = new Date ( ) ;
52+ const timestamp = date . toISOString ( ) ;
53+ console . log ( `[${ timestamp } ] ${ message } ` ) ;
54+ }
55+
5056export const testOIDCFieldAuth = ( engine : ImportedRDSType ) : void => {
5157 describe ( 'SQL OIDC provider Field Auth tests' , ( ) => {
5258 const [ db_user , db_password , db_identifier ] = generator . generateMultiple ( 3 ) ;
@@ -76,9 +82,12 @@ export const testOIDCFieldAuth = (engine: ImportedRDSType): void => {
7682 const apiName = projName ;
7783
7884 beforeAll ( async ( ) => {
85+ logTimestamp ( 'beforeAll start' ) ;
7986 console . log ( sqlCreateStatements ( engine ) ) ;
8087 projRoot = await createNewProjectDir ( projName ) ;
88+ logTimestamp ( 'beforeAll before setupAmplifyProject' ) ;
8189 await setupAmplifyProject ( ) ;
90+ logTimestamp ( 'beforeAll end' ) ;
8291 } ) ;
8392
8493 afterAll ( async ( ) => {
@@ -111,21 +120,31 @@ export const testOIDCFieldAuth = (engine: ImportedRDSType): void => {
111120 } ;
112121
113122 const setupAmplifyProject = async ( ) : Promise < void > => {
123+ logTimestamp ( 'setupAmplifyProject start' ) ;
124+
125+ logTimestamp ( 'setupAmplifyProject initJSProjectWithProfile' ) ;
114126 await initJSProjectWithProfile ( projRoot , {
115127 disableAmplifyAppCreation : false ,
116128 name : projName ,
117129 } ) ;
118130
131+ logTimestamp ( 'setupAmplifyProject getProjectMeta' ) ;
119132 const metaAfterInit = getProjectMeta ( projRoot ) ;
120133 region = metaAfterInit . providers . awscloudformation . Region ;
121134
135+ logTimestamp ( 'setupAmplifyProject addAuthWithPreTokenGenerationTrigger' ) ;
122136 await addAuthWithPreTokenGenerationTrigger ( projRoot ) ;
137+
138+ logTimestamp ( 'setupAmplifyProject updatePreAuthTrigger' ) ;
123139 updatePreAuthTrigger ( projRoot , 'user_id' ) ;
140+
141+ logTimestamp ( 'setupAmplifyProject amplifyPush' ) ;
124142 await amplifyPush ( projRoot , false , {
125143 useBetaSqlLayer : SQL_TESTS_USE_BETA ,
126144 skipCodegen : true ,
127145 } ) ;
128146
147+ logTimestamp ( 'setupAmplifyProject addApi' ) ;
129148 await addApi ( projRoot , {
130149 'OpenID Connect' : {
131150 oidcProviderName : 'awscognitouserpool' ,
@@ -142,7 +161,10 @@ export const testOIDCFieldAuth = (engine: ImportedRDSType): void => {
142161 const ddbSchemaFilePath = path . join ( projRoot , 'amplify' , 'backend' , 'api' , apiName , 'schema.graphql' ) ;
143162 removeSync ( ddbSchemaFilePath ) ;
144163
164+ logTimestamp ( 'setupAmplifyProject setupDatabase' ) ;
145165 await setupDatabase ( ) ;
166+
167+ logTimestamp ( 'setupAmplifyProject importRDSDatabase' ) ;
146168 await importRDSDatabase ( projRoot , {
147169 database,
148170 engine,
@@ -156,24 +178,42 @@ export const testOIDCFieldAuth = (engine: ImportedRDSType): void => {
156178
157179 writeFileSync ( rdsSchemaFilePath , appendAmplifyInput ( schema , engine ) , 'utf8' ) ;
158180
181+ logTimestamp ( 'setupAmplifyProject updateAuthAddUserGroups' ) ;
159182 await updateAuthAddUserGroups ( projRoot , [ adminGroupName , devGroupName ] ) ;
183+
184+ logTimestamp ( 'setupAmplifyProject amplifyPush' ) ;
160185 await amplifyPush ( projRoot , false , {
161186 useBetaSqlLayer : SQL_TESTS_USE_BETA ,
162187 } ) ;
163188 await sleep ( 30 * 1000 ) ; // Wait for 30 seconds for the VPC endpoints to be live.
164189
190+ logTimestamp ( 'setupAmplifyProject getUserPoolId' ) ;
165191 const userPoolId = getUserPoolId ( projRoot ) ;
192+
193+ logTimestamp ( 'setupAmplifyProject configureAmplify' ) ;
166194 configureAmplify ( projRoot ) ;
195+
196+ logTimestamp ( 'setupAmplifyProject setupUser(s)' ) ;
167197 await setupUser ( userPoolId , userName1 , userPassword , adminGroupName ) ;
168198 await setupUser ( userPoolId , userName2 , userPassword , devGroupName ) ;
199+
200+ logTimestamp ( 'setupAmplifyProject getAppSyncEndpoint' ) ;
169201 graphQlEndpoint = getAppSyncEndpoint ( projRoot , apiName ) ;
202+
203+ logTimestamp ( 'setupAmplifyProject signInUser(s)' ) ;
170204 const user1 = await signInUser ( userName1 , userPassword ) ;
171205 userMap [ userName1 ] = user1 ;
172206 const user2 = await signInUser ( userName2 , userPassword ) ;
173207 userMap [ userName2 ] = user2 ;
208+
209+ logTimestamp ( 'setupAmplifyProject configureAppSyncClients' ) ;
174210 const appSyncClients = await configureAppSyncClients ( projRoot , apiName , [ oidcProvider , apiKeyProvider ] , userMap ) ;
211+
212+ logTimestamp ( 'setupAmplifyProject createModelOperationHelpers(s)' ) ;
175213 user1ModelOperationHelpers = createModelOperationHelpers ( appSyncClients [ oidcProvider ] [ userName1 ] , schema ) ;
176214 user2ModelOperationHelpers = createModelOperationHelpers ( appSyncClients [ oidcProvider ] [ userName2 ] , schema ) ;
215+
216+ logTimestamp ( 'setupAmplifyProject end' ) ;
177217 } ;
178218
179219 test ( 'Private model auth and allowed field operations' , async ( ) => {
0 commit comments