-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add ability to run protocol tests as unit tests of a service #1590
Conversation
Sources/Core/AWSClientRuntime/Middlewares/Sha256TreeHashMiddleware.swift
Show resolved
Hide resolved
Sources/Core/AWSClientRuntime/Middlewares/Sha256TreeHashMiddleware.swift
Show resolved
Hide resolved
shouldUseLaunchSchemeArgsEnv = "YES"> | ||
<TestPlans> | ||
<TestPlanReference | ||
reference = "container:XCTestPlans/ProtocolTestPlan.xctestplan" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to upload the scheme so that we ensure it includes our reference to using ProtocolTestPlan
"S3PreservesEmbeddedDotSegmentInUriLabel", // moved to s3-tests.smithy | ||
"S3PreservesLeadingDotSegmentInUriLabel", // moved to s3-tests.smithy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests that have been moved to s3-tests.smithy would still remain ignored here for when they are pulled from smithy. They have been copied and renamed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If tests that have been copied over to s3-tests.smithy
are modified or added to, how will we know (other than manually checking those test models)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
they'll continue to be marked as disabled here with a comment noting they've been moved. Another place to check is in AdditionalServiceTests/ folder for the smithy file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall good, but it appears there are several things in test setup & config that can be eliminated.
@@ -6,6 +6,9 @@ on: | |||
workflow_dispatch: | |||
pull_request: | |||
|
|||
permissions: | |||
id-token: write | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this? Doesn't look like we use write
in this job.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll try removing it
method: .delete, | ||
path: "/my%20key.txt", | ||
headers: [ | ||
"Content-Type": "application/json" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this PR need to have its codegen updated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh yes it does
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This name matches the scheme that Xcode auto-generates for a package. Are you sure we need this to be committed explicitly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it doesnt need to be committed as it will get generated, but I thought we keep Sources/Services/ codegen committed and up to date?
@@ -109,8 +112,10 @@ jobs: | |||
run: | | |||
cd codegen/ | |||
set -o pipefail && \ | |||
NSUnbufferedIO=YES xcodebuild \ | |||
xcodebuild -showTestPlans -scheme aws-sdk-swift-protocol-tests-Package && \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this here just for troubleshooting? Can we get rid of it?
@@ -7,6 +7,9 @@ on: | |||
env: | |||
AWS_SWIFT_SDK_USE_LOCAL_DEPS: 1 | |||
|
|||
permissions: | |||
id-token: write | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are you sure we can't get rid of these extra permissions in CI? IIRC this is needed to get AWS credentials through OpenID which we don't do in the CI workflow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the linux side I'm using aws-actions/configure-aws-credentials@v3
still. Would rather I try to change this one to fake credentials?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, let's not get real credentials where fake ones will do
"S3PreservesEmbeddedDotSegmentInUriLabel", // moved to s3-tests.smithy | ||
"S3PreservesLeadingDotSegmentInUriLabel", // moved to s3-tests.smithy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If tests that have been copied over to s3-tests.smithy
are modified or added to, how will we know (other than manually checking those test models)?
Issue #
Description of changes
New/existing dependencies impact assessment, if applicable
Conventional Commits
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.