-
Notifications
You must be signed in to change notification settings - Fork 81
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
chore: Protocol tests set their own AWS credentials #1784
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -118,7 +118,6 @@ jobs: | |
set -o pipefail && \ | ||
NSUnbufferedIO=YES xcodebuild \ | ||
-scheme aws-sdk-swift-protocol-tests-Package \ | ||
-testPlan ProtocolTestPlan \ | ||
-destination '${{ matrix.destination }}' \ | ||
test 2>&1 \ | ||
| xcbeautify | ||
|
@@ -183,18 +182,6 @@ jobs: | |
run: ./scripts/ci_steps/install_native_linux_dependencies.sh | ||
- name: Tools Versions | ||
run: ./scripts/ci_steps/log_tool_versions.sh | ||
# Configure fake credentials using profiles | ||
- name: (Credentials 1/3) Create AWS config directory | ||
run: mkdir -p ~/.aws | ||
- name: (Credentials 2/3) Create AWS config file | ||
run: | | ||
echo "[default]" > ~/.aws/config | ||
echo "region=us-west-2" >> ~/.aws/config | ||
- name: (Credentials 3/3) Create AWS credentials file | ||
run: | | ||
echo "[default]" > ~/.aws/credentials | ||
echo "aws_access_key_id = test-key-id" >> ~/.aws/credentials | ||
echo "aws_secret_access_key = test-secret-access-key" >> ~/.aws/credentials | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The code above is deleted since credentials are now provided statically at protocol test client creation. |
||
- name: Prepare Protocol & Unit Tests | ||
run: | | ||
./scripts/ci_steps/prepare_protocol_and_unit_tests.sh | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ import ClientRuntime | |
import Smithy | ||
import SmithyTestUtil | ||
import XCTest | ||
import func SmithyTestUtil.dummyIdentityResolver | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The 4 tests below demonstrate the code changes to protocol tests. The |
||
|
||
|
||
class DeleteObjectTaggingRequestTest: HttpRequestTestBase { | ||
|
@@ -28,10 +29,13 @@ class DeleteObjectTaggingRequestTest: HttpRequestTestBase { | |
resolvedHost: "mybucket.s3.us-west-2.amazonaws.com" | ||
) | ||
|
||
let config = try await S3Client.S3ClientConfiguration() | ||
config.region = "us-west-2" | ||
config.httpClientEngine = ProtocolTestClient() | ||
config.idempotencyTokenGenerator = ProtocolTestIdempotencyTokenGenerator() | ||
let config = try await S3Client.Config( | ||
awsCredentialIdentityResolver: try SmithyTestUtil.dummyIdentityResolver(), | ||
region: "us-west-2", | ||
signingRegion: "us-west-2", | ||
idempotencyTokenGenerator: ProtocolTestIdempotencyTokenGenerator(), | ||
httpClientEngine: ProtocolTestClient() | ||
) | ||
let client = S3Client(config: config) | ||
|
||
let input = DeleteObjectTaggingInput( | ||
|
@@ -57,10 +61,13 @@ class DeleteObjectTaggingRequestTest: HttpRequestTestBase { | |
resolvedHost: "mybucket.s3.us-west-2.amazonaws.com" | ||
) | ||
|
||
let config = try await S3Client.S3ClientConfiguration() | ||
config.region = "us-west-2" | ||
config.httpClientEngine = ProtocolTestClient() | ||
config.idempotencyTokenGenerator = ProtocolTestIdempotencyTokenGenerator() | ||
let config = try await S3Client.Config( | ||
awsCredentialIdentityResolver: try SmithyTestUtil.dummyIdentityResolver(), | ||
region: "us-west-2", | ||
signingRegion: "us-west-2", | ||
idempotencyTokenGenerator: ProtocolTestIdempotencyTokenGenerator(), | ||
httpClientEngine: ProtocolTestClient() | ||
) | ||
let client = S3Client(config: config) | ||
|
||
let input = DeleteObjectTaggingInput( | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ import Foundation | |
import Smithy | ||
import SmithyTestUtil | ||
import XCTest | ||
import func SmithyTestUtil.dummyIdentityResolver | ||
|
||
|
||
class GetObjectRequestTest: HttpRequestTestBase { | ||
|
@@ -26,10 +27,13 @@ class GetObjectRequestTest: HttpRequestTestBase { | |
resolvedHost: "mybucket.s3.us-west-2.amazonaws.com" | ||
) | ||
|
||
let config = try await S3Client.S3ClientConfiguration() | ||
config.region = "us-west-2" | ||
config.httpClientEngine = ProtocolTestClient() | ||
config.idempotencyTokenGenerator = ProtocolTestIdempotencyTokenGenerator() | ||
let config = try await S3Client.Config( | ||
awsCredentialIdentityResolver: try SmithyTestUtil.dummyIdentityResolver(), | ||
region: "us-west-2", | ||
signingRegion: "us-west-2", | ||
idempotencyTokenGenerator: ProtocolTestIdempotencyTokenGenerator(), | ||
httpClientEngine: ProtocolTestClient() | ||
) | ||
let client = S3Client(config: config) | ||
|
||
let input = GetObjectInput( | ||
|
@@ -52,10 +56,13 @@ class GetObjectRequestTest: HttpRequestTestBase { | |
resolvedHost: "mybucket.s3.us-west-2.amazonaws.com" | ||
) | ||
|
||
let config = try await S3Client.S3ClientConfiguration() | ||
config.region = "us-west-2" | ||
config.httpClientEngine = ProtocolTestClient() | ||
config.idempotencyTokenGenerator = ProtocolTestIdempotencyTokenGenerator() | ||
let config = try await S3Client.Config( | ||
awsCredentialIdentityResolver: try SmithyTestUtil.dummyIdentityResolver(), | ||
region: "us-west-2", | ||
signingRegion: "us-west-2", | ||
idempotencyTokenGenerator: ProtocolTestIdempotencyTokenGenerator(), | ||
httpClientEngine: ProtocolTestClient() | ||
) | ||
let client = S3Client(config: config) | ||
|
||
let input = GetObjectInput( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The
|
||
|
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 protocol test plan is deleted (see below). Its only purpose was to get credentials into Xcode test runs, now this is done in protocol test setup.