[examples] add an example project to show test strategies - #438
Merged
Conversation
0xTim
reviewed
Dec 23, 2024
0xTim
left a comment
Collaborator
There was a problem hiding this comment.
Some queries around testing infrastructure
| /// This interface is not part of the public API and must not be used by adopters. | ||
| /// It is declared public to allow users to unit test their handler. | ||
| /// This API is not part of semver versioning. | ||
| public static func __forTestsOnly( |
Collaborator
There was a problem hiding this comment.
Why are we making this public if it can be visible with @testable?
Collaborator
There was a problem hiding this comment.
If we want it public, we might want to consider introducing a LambdaTesting target to keep it separate
Collaborator
Author
There was a problem hiding this comment.
You're correct, I was importing @testable import AWSLambdaRuntime but I needed AWSLambdaRuntimeCore
This is fixed now, this PR only touches files in the Examples directory. Thank you !
sebsto
force-pushed
the
sebsto/example_test
branch
from
December 24, 2024 08:01
61dda3a to
17cc50c
Compare
Collaborator
Author
|
Note that the integration tests fail pending merging of #441 |
sebsto
force-pushed
the
sebsto/example_test
branch
from
December 24, 2024 08:41
821f2dd to
3cb188d
Compare
0xTim
approved these changes
Dec 25, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This new example project show four testing strategies for Swift Lambda function
[IMPORTANT]
To allow testing the handler, I had to change visibility of a method in the Runtime project. This method is clearly marked for testing only, so it should not be a problem. Happy to read feedback and discuss however.