Skip to content

Commit

Permalink
chore(sdk): queue batch test can't use snapshots because execution or…
Browse files Browse the repository at this point in the history
…der is not guaranteed (#3881)

See title

*By submitting this pull request, I confirm that my contribution is made under the terms of the [Wing Cloud Contribution License](https://github.com/winglang/wing/blob/main/CONTRIBUTION_LICENSE.md)*.
  • Loading branch information
MarkMcCulloh authored Aug 18, 2023
1 parent f30b02c commit c3aab87
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 30 deletions.
29 changes: 0 additions & 29 deletions libs/wingsdk/test/target-sim/__snapshots__/queue.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -736,35 +736,6 @@ exports[`queue batch size of 2, purge the queue 2`] = `
`;

exports[`queue with one subscriber, batch size of 5 1`] = `
[
"wingsdk.cloud.TestRunner created.",
"wingsdk.cloud.Function created.",
"wingsdk.cloud.Queue created.",
"wingsdk.sim.EventMapping created.",
"wingsdk.cloud.Function created.",
"Push (messages=A).",
"Push (messages=B).",
"Push (messages=C).",
"Push (messages=D).",
"Push (messages=E).",
"Push (messages=F).",
"Invoke (payload=\\"\\").",
"OnDeploy invoked.",
"wingsdk.cloud.OnDeploy created.",
"Sending messages (messages=[\\"A\\",\\"B\\",\\"C\\",\\"D\\",\\"E\\"], subscriber=sim-1).",
"Sending messages (messages=[\\"F\\"], subscriber=sim-1).",
"Invoke (payload=\\"{\\\\\\"messages\\\\\\":[\\\\\\"A\\\\\\",\\\\\\"B\\\\\\",\\\\\\"C\\\\\\",\\\\\\"D\\\\\\",\\\\\\"E\\\\\\"]}\\").",
"Invoke (payload=\\"{\\\\\\"messages\\\\\\":[\\\\\\"F\\\\\\"]}\\").",
"wingsdk.cloud.OnDeploy deleted.",
"wingsdk.cloud.Function deleted.",
"wingsdk.sim.EventMapping deleted.",
"wingsdk.cloud.Queue deleted.",
"wingsdk.cloud.Function deleted.",
"wingsdk.cloud.TestRunner deleted.",
]
`;

exports[`queue with one subscriber, batch size of 5 2`] = `
{
".wing/function_c8ab799f.js": "exports.handler = async function(event) {
return await (new ((function(){
Expand Down
6 changes: 5 additions & 1 deletion libs/wingsdk/test/target-sim/queue.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,11 @@ async handle() {
// THEN
await s.stop();

expect(listMessages(s)).toMatchSnapshot();
const traces = s.listTraces().map((trace) => trace.data.message);
expect(traces).toContain(
'Invoke (payload="{\\"messages\\":[\\"A\\",\\"B\\",\\"C\\",\\"D\\",\\"E\\"]}").'
);
expect(traces).toContain('Invoke (payload="{\\"messages\\":[\\"F\\"]}").');
expect(app.snapshot()).toMatchSnapshot();
});

Expand Down

0 comments on commit c3aab87

Please sign in to comment.