Skip to content

Commit 17b7023

Browse files
committed
Merge branch 'test_proxy_ios' of https://github.com/awslabs/aws-crt-swift into test_proxy_ios
2 parents f4d6cdb + 1856ec0 commit 17b7023

10 files changed

Lines changed: 77 additions & 33 deletions

File tree

.builder/actions/xcode-tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def run(self, env):
88
commands =[
99
'xcodebuild',
1010
'-scheme',
11-
'aws-crt-swift-Package',
11+
'aws-crt-swift',
1212
'test',
1313
'-destination',
1414
"platform={}".format(destination)

Package.swift

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,7 @@ var package = Package(
1212
name: "aws-crt-swift",
1313
platforms: [.iOS(.v13), .macOS(.v10_15), .tvOS(.v13), .watchOS(.v6)],
1414
products: [
15-
.library(name: "AwsCommonRuntimeKit", targets: ["AwsCommonRuntimeKit"]),
16-
.executable(name: "Elasticurl", targets: ["Elasticurl"]),
17-
.executable(name: "Mqtt5Canary", targets: ["Mqtt5Canary"]),
18-
],
19-
dependencies: [
20-
// Arugment Parser Dependency for ElasticCurl
21-
.package(
22-
url: "https://github.com/apple/swift-argument-parser.git", exact: "1.2.3")
15+
.library(name: "AwsCommonRuntimeKit", targets: ["AwsCommonRuntimeKit"])
2316
]
2417
)
2518

@@ -371,21 +364,5 @@ packageTargets.append(contentsOf: [
371364
],
372365
swiftSettings: swiftTestSettings
373366
),
374-
.executableTarget(
375-
name: "Elasticurl",
376-
dependencies: [
377-
"AwsCommonRuntimeKit",
378-
.product(name: "ArgumentParser", package: "swift-argument-parser"),
379-
],
380-
path: "Source/Elasticurl"
381-
),
382-
.executableTarget(
383-
name: "Mqtt5Canary",
384-
dependencies: [
385-
"AwsCommonRuntimeKit",
386-
.product(name: "ArgumentParser", package: "swift-argument-parser"),
387-
],
388-
path: "Source/Canary/Mqtt5Canary"
389-
),
390367
])
391368
package.targets = packageTargets
File renamed without changes.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// swift-tools-version: 5.9
2+
// The swift-tools-version declares the minimum version of Swift required to build this package.
3+
4+
import PackageDescription
5+
6+
let package = Package(
7+
name: "Mqtt5Canary",
8+
platforms: [
9+
.iOS(.v13),
10+
.macOS(.v10_15),
11+
.tvOS(.v13),
12+
],
13+
products: [
14+
.executable(name: "Mqtt5Canary", targets: ["Mqtt5Canary"])
15+
],
16+
dependencies: [
17+
.package(path: "../../../"),
18+
// This package gives us the capability to do a argument parsing
19+
.package(url: "https://github.com/apple/swift-argument-parser", exact: "1.2.3"),
20+
],
21+
targets: [
22+
// Targets are the basic building blocks of a package, defining a module or a test suite.
23+
// Targets can depend on other targets in this package and products from dependencies.
24+
.executableTarget(
25+
name: "Mqtt5Canary",
26+
dependencies: [
27+
.product(name: "AwsCommonRuntimeKit", package: "aws-crt-swift"),
28+
.product(name: "ArgumentParser", package: "swift-argument-parser"),
29+
],
30+
path: ".")
31+
]
32+
)

Test/Elasticurl/Package.swift

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// swift-tools-version: 5.9
2+
// The swift-tools-version declares the minimum version of Swift required to build this package.
3+
4+
import PackageDescription
5+
6+
let package = Package(
7+
name: "Elasticurl",
8+
platforms: [
9+
.iOS(.v13),
10+
.macOS(.v10_15),
11+
.tvOS(.v13),
12+
],
13+
products: [
14+
.executable(name: "Elasticurl", targets: ["Elasticurl"])
15+
],
16+
dependencies: [
17+
.package(path: "../../"),
18+
// This package gives us the capability to do a argument parsing
19+
.package(url: "https://github.com/apple/swift-argument-parser", exact: "1.2.3"),
20+
],
21+
targets: [
22+
// Targets are the basic building blocks of a package, defining a module or a test suite.
23+
// Targets can depend on other targets in this package and products from dependencies.
24+
.executableTarget(
25+
name: "Elasticurl",
26+
dependencies: [
27+
.product(name: "AwsCommonRuntimeKit", package: "aws-crt-swift"),
28+
.product(name: "ArgumentParser", package: "swift-argument-parser"),
29+
],
30+
path: ".")
31+
]
32+
)

builder.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,22 @@
2525
"targets": {
2626
"ios": {
2727
"!build_steps": [
28-
"xcodebuild -scheme AwsCommonRuntimeKit -destination 'generic/platform=iOS'"
28+
"xcodebuild -scheme aws-crt-swift -destination 'generic/platform=iOS'"
2929
]
3030
},
3131
"tvos": {
3232
"!build_steps": [
33-
"xcodebuild -scheme AwsCommonRuntimeKit -destination 'generic/platform=tvOS'"
33+
"xcodebuild -scheme aws-crt-swift -destination 'generic/platform=tvOS'"
3434
]
3535
},
3636
"watchos": {
3737
"!build_steps": [
38-
"xcodebuild -scheme AwsCommonRuntimeKit -destination 'generic/platform=watchOS'"
38+
"xcodebuild -scheme aws-crt-swift -destination 'generic/platform=watchOS'"
3939
]
4040
},
4141
"macos": {
4242
"+test_steps": [
43+
"cd Test/Elasticurl && swift build -c release",
4344
"./integ_test.sh"
4445
]
4546
},

codebuild/canary/mqtt5-swift-canary-dispatch-test.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,12 @@ phases:
5151
sed -i '' '177i\
5252
cSettingsIO.append(.define("AWS_USE_APPLE_NETWORK_FRAMEWORK"))
5353
' Package.swift
54+
- cd Test/Canary/Mqtt5Canary
5455
# pull and copy canary scripts
5556
- git clone git@github.com:awslabs/aws-crt-canaries.git
56-
- cp aws-crt-canaries/source/mqtt5/*.py codebuild/canary
57+
- cp aws-crt-canaries/source/mqtt5/*.py .
5758
# Run the Canary
58-
- python3 codebuild/canary/CanaryWrapper.py --canary_executable swift --canary_arguments "run Mqtt5Canary --endpoint ${ENDPOINT} --seconds ${CANARY_DURATION} --tps ${CANARY_TPS} --threads ${CANARY_THREADS} -c ${CANARY_CLIENT_COUNT} --verbose ${CANARY_LOG_LEVEL}" --git_hash ${GIT_HASH} --git_repo_name $PACKAGE_NAME --ticket_item "${CODEBUILD_TICKET_ITEM}" --cloudwatch_namespace mqtt5_swift_canary
59+
- python3 CanaryWrapper.py --canary_executable swift --canary_arguments "run Mqtt5Canary --endpoint ${ENDPOINT} --seconds ${CANARY_DURATION} --tps ${CANARY_TPS} --threads ${CANARY_THREADS} -c ${CANARY_CLIENT_COUNT} --verbose ${CANARY_LOG_LEVEL}" --git_hash ${GIT_HASH} --git_repo_name $PACKAGE_NAME --ticket_item "${CODEBUILD_TICKET_ITEM}" --cloudwatch_namespace mqtt5_swift_canary
5960
post_build:
6061
commands:
6162
- echo Build completed on `date`

codebuild/canary/mqtt5-swift-canary-kqueue-test.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,12 @@ phases:
5656
- export GIT_HASH=$(git rev-parse HEAD)
5757
# Get the endpoint, certificate, and key for connecting to IoT Core
5858
- export ENDPOINT=$(aws secretsmanager get-secret-value --secret-id ${CANARY_SERVER_ARN} --query "SecretString" | cut -f2 -d":" | sed -e 's/[\\\"\}]//g')
59+
- cd Test/Canary/Mqtt5Canary
5960
# pull and copy canary scripts
6061
- git clone git@github.com:awslabs/aws-crt-canaries.git
61-
- cp aws-crt-canaries/source/mqtt5/*.py codebuild/canary
62+
- cp aws-crt-canaries/source/mqtt5/*.py .
6263
# Run the Canary
63-
- python3 codebuild/canary/CanaryWrapper.py --canary_executable swift --canary_arguments "run Mqtt5Canary --endpoint ${ENDPOINT} --seconds ${CANARY_DURATION} --tps ${CANARY_TPS} --threads ${CANARY_THREADS} -c ${CANARY_CLIENT_COUNT}" --git_hash ${GIT_HASH} --git_repo_name $PACKAGE_NAME --ticket_item "${CODEBUILD_TICKET_ITEM}" --cloudwatch_namespace mqtt5_swift_canary
64+
- python3 CanaryWrapper.py --canary_executable swift --canary_arguments "run Mqtt5Canary --endpoint ${ENDPOINT} --seconds ${CANARY_DURATION} --tps ${CANARY_TPS} --threads ${CANARY_THREADS} -c ${CANARY_CLIENT_COUNT}" --git_hash ${GIT_HASH} --git_repo_name $PACKAGE_NAME --ticket_item "${CODEBUILD_TICKET_ITEM}" --cloudwatch_namespace mqtt5_swift_canary
6465
post_build:
6566
commands:
6667
- echo Build completed on `date`

integ_test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/bash
22
curl -L -o /tmp/http_client_test.py https://raw.githubusercontent.com/awslabs/aws-c-http/main/integration-testing/http_client_test.py
33
ARCH=$(uname -a | sed 's/.* \([^ ]*\)$/\1/')
4-
python3 /tmp/http_client_test.py .build/$ARCH-apple-macosx/release/Elasticurl
4+
python3 /tmp/http_client_test.py Test/Elasticurl/.build/$ARCH-apple-macosx/release/Elasticurl

0 commit comments

Comments
 (0)