Skip to content

Commit 5c3bc34

Browse files
committed
Fix expected call count in s3 integration tests 🎱
1 parent 999af8e commit 5c3bc34

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

tests/serverless-plugins-integration/serverless.s3.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,14 @@ functions:
2222
- s3:
2323
bucket: pictures
2424
event: s3:ObjectCreated:Put
25-
25+
2626
myCallbackHandler:
2727
handler: lambda/handler.callback
2828
events:
2929
- s3:
3030
bucket: files
3131
event: s3:ObjectCreated:Put
32+
3233
myPythonHandler:
3334
runtime: python3.7
3435
handler: lambda/handler.handler

tests/serverless-plugins-integration/test-s3.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ const uploadFiles = async () => {
2727
client.fPutObject('files', 'second.txt', path)
2828
]);
2929
};
30+
const EXPECED_LAMBDA_CALL = 8; // pictures files are consumed twice, by myPromiseHandler and myPythonHandler
3031

3132
const serverless = spawn('serverless', ['--config', 'serverless.s3.yml', 'offline', 'start'], {
3233
stdio: ['pipe', 'pipe', 'pipe'],
@@ -49,7 +50,7 @@ serverless.stdout.pipe(
4950
/offline: \(λ: .*\) RequestId: .* Duration: .* ms {2}Billed Duration: .* ms/g
5051
) || []
5152
).length;
52-
if (this.count === 6) serverless.kill();
53+
if (this.count === EXPECED_LAMBDA_CALL) serverless.kill();
5354
cb();
5455
}
5556
})

0 commit comments

Comments
 (0)