Skip to content

Add Lambda unit tests#66

Merged
tylercunnion merged 8 commits into
mainfrom
tyler/add-lambda-unit-tests
Jul 1, 2026
Merged

Add Lambda unit tests#66
tylercunnion merged 8 commits into
mainfrom
tyler/add-lambda-unit-tests

Conversation

@tylercunnion

@tylercunnion tylercunnion commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

What was changed

Add unit tests for Lamba Invoke and ValidateConfig logic.
Since the logic for these requires a Lambda Client, this change adds a package-level variable (the same as we currently have for verifyExternalIDEnforced) that allows us to swap in, on a test-only basis, a function to provide our own struct that implements the minimal interface required here.

Why?

Verifying that the AWS Lambda API is called in the way we expect when receiving an Invoke signal is crucial to the overall test strategy. Since integration tests will check only that a TQ backlog leads to a (non-provider-specific) Invoke call, we need the unit tests to verify that those Invoke calls do what we expect.

@tylercunnion
tylercunnion marked this pull request as ready for review July 1, 2026 02:09
@tylercunnion
tylercunnion requested a review from a team as a code owner July 1, 2026 02:09

@jaypipes jaypipes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are fine since they follow the existing unit test pattern. I'm not sure the stubbed/mocked unit tests provide a whole lot of value compared to integration tests, but OK :)

@tylercunnion

Copy link
Copy Markdown
Contributor Author

These are fine since they follow the existing unit test pattern. I'm not sure the stubbed/mocked unit tests provide a whole lot of value compared to integration tests, but OK :)

Yeah the main value they provide is the "last mile" validation - integration test proves out every part of the WCI machinery up to calling "Invoke" etc on the compute provider. Since we don't have a real compute provider wired up in the integration test, this will prove that each individual provider responds correctly to the Invoke call. So it's a smaller portion of the overall picture but still important in their own right

@tylercunnion
tylercunnion merged commit 9aff8cf into main Jul 1, 2026
8 checks passed
@tylercunnion
tylercunnion deleted the tyler/add-lambda-unit-tests branch July 1, 2026 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants