@@ -129,7 +129,7 @@ test.serial(`helloGCS: should print uploaded message`, async (t) => {
129
129
130
130
// Check logs
131
131
await tools . tryTest ( async ( assert ) => {
132
- const logs = await tools . runAsync ( `${ baseCmd } logs read helloPubSub --start-time ${ startTime } ` ) ;
132
+ const logs = await tools . runAsync ( `${ baseCmd } logs read helloGCS --start-time ${ startTime } ` ) ;
133
133
assert ( logs . includes ( `File ${ fileName } uploaded` ) ) ;
134
134
} ) ;
135
135
} ) ;
@@ -143,11 +143,27 @@ test.serial(`helloGCS: should print metadata updated message`, async (t) => {
143
143
144
144
// Check logs
145
145
await tools . tryTest ( async ( assert ) => {
146
- const logs = await tools . runAsync ( `${ baseCmd } logs read helloPubSub --start-time ${ startTime } ` ) ;
146
+ const logs = await tools . runAsync ( `${ baseCmd } logs read helloGCS --start-time ${ startTime } ` ) ;
147
147
assert ( logs . includes ( `File ${ fileName } metadata updated` ) ) ;
148
148
} ) ;
149
149
} ) ;
150
150
151
+ test . serial ( `helloGCSGeneric: should print event details` , async ( t ) => {
152
+ t . plan ( 0 ) ;
153
+ const startTime = new Date ( Date . now ( ) ) . toISOString ( ) ;
154
+
155
+ // Update file metadata
156
+ await bucket . setMetadata ( fileName , { foo : `baz` } ) ;
157
+
158
+ // Check logs
159
+ await tools . tryTest ( async ( assert ) => {
160
+ const logs = await tools . runAsync ( `${ baseCmd } logs read helloGCSGeneric --start-time ${ startTime } ` ) ;
161
+ assert ( logs . includes ( `Bucket: ${ bucketName } ` ) ) ;
162
+ assert ( logs . includes ( `File: ${ fileName } ` ) ) ;
163
+ assert ( logs . includes ( `Event type: google.storage.object.metadataUpdate` ) ) ;
164
+ } ) ;
165
+ } ) ;
166
+
151
167
test . serial ( `helloGCS: should print deleted message` , async ( t ) => {
152
168
t . plan ( 0 ) ;
153
169
const startTime = new Date ( Date . now ( ) ) . toISOString ( ) ;
@@ -157,7 +173,7 @@ test.serial(`helloGCS: should print deleted message`, async (t) => {
157
173
158
174
// Check logs
159
175
await tools . tryTest ( async ( assert ) => {
160
- const logs = await tools . runAsync ( `${ baseCmd } logs read helloPubSub --start-time ${ startTime } ` ) ;
176
+ const logs = await tools . runAsync ( `${ baseCmd } logs read helloGCS --start-time ${ startTime } ` ) ;
161
177
assert ( logs . includes ( `File ${ fileName } deleted` ) ) ;
162
178
} ) ;
163
179
} ) ;
0 commit comments