Skip to content
This repository was archived by the owner on Mar 19, 2024. It is now read-only.

Commit 33ec012

Browse files
Update Travis CI
1 parent 7a07004 commit 33ec012

File tree

6 files changed

+223
-34
lines changed

6 files changed

+223
-34
lines changed

.travis.yml

+11-30
Original file line numberDiff line numberDiff line change
@@ -27,40 +27,21 @@ before_install:
2727
install:
2828
- make --version
2929
- make docker_build
30-
31-
script:
3230
- docker image ls
3331
- make package_layer
3432
- make package_lambda
35-
- make swift_test
36-
- make swift_test SWIFT_EXECUTABLE=HTTPSRequest SWIFT_PROJECT_PATH=Examples/HTTPSRequest LAMBDA_FUNCTION_NAME=HTTPSRequest LAMBDA_HANDLER=HTTPSRequest.getHttps
37-
- make swift_test SWIFT_EXECUTABLE=S3Test SWIFT_PROJECT_PATH=Examples/S3Test LAMBDA_FUNCTION_NAME=S3Test LAMBDA_HANDLER=S3Test.getObject
38-
- make build_lambda_local SWIFT_EXECUTABLE=HelloWorld SWIFT_PROJECT_PATH=Examples/HelloWorld LAMBDA_FUNCTION_NAME=HelloWorld LAMBDA_HANDLER=HelloWorld.helloWorld
39-
- make start_docker_compose_env SWIFT_EXECUTABLE=HelloWorld SWIFT_PROJECT_PATH=Examples/HelloWorld LAMBDA_FUNCTION_NAME=HelloWorld LAMBDA_HANDLER=HelloWorld.helloWorld
40-
- make invoke_lambda_local SWIFT_EXECUTABLE=HelloWorld SWIFT_PROJECT_PATH=Examples/HelloWorld LAMBDA_FUNCTION_NAME=HelloWorld LAMBDA_HANDLER=HelloWorld.helloWorld
41-
- make stop_docker_compose_env SWIFT_EXECUTABLE=HelloWorld SWIFT_PROJECT_PATH=Examples/HelloWorld LAMBDA_FUNCTION_NAME=HelloWorld LAMBDA_HANDLER=HelloWorld.helloWorld
42-
- make test_lambda_local_output SWIFT_EXECUTABLE=HelloWorld SWIFT_PROJECT_PATH=Examples/HelloWorld LAMBDA_FUNCTION_NAME=HelloWorld LAMBDA_HANDLER=HelloWorld.helloWorld
43-
- make build_lambda_local SWIFT_EXECUTABLE=HTTPSRequest SWIFT_PROJECT_PATH=Examples/HTTPSRequest LAMBDA_FUNCTION_NAME=HTTPSRequest LAMBDA_HANDLER=HTTPSRequest.getHttps
44-
- make start_docker_compose_env SWIFT_EXECUTABLE=HTTPSRequest SWIFT_PROJECT_PATH=Examples/HTTPSRequest LAMBDA_FUNCTION_NAME=HTTPSRequest LAMBDA_HANDLER=HTTPSRequest.getHttps
45-
- make invoke_lambda_local SWIFT_EXECUTABLE=HTTPSRequest SWIFT_PROJECT_PATH=Examples/HTTPSRequest LAMBDA_FUNCTION_NAME=HTTPSRequest LAMBDA_HANDLER=HTTPSRequest.getHttps
46-
- make stop_docker_compose_env SWIFT_EXECUTABLE=HTTPSRequest SWIFT_PROJECT_PATH=Examples/HTTPSRequest LAMBDA_FUNCTION_NAME=HTTPSRequest LAMBDA_HANDLER=HTTPSRequest.getHttps
47-
- make test_lambda_local_output SWIFT_EXECUTABLE=HTTPSRequest SWIFT_PROJECT_PATH=Examples/HTTPSRequest LAMBDA_FUNCTION_NAME=HTTPSRequest LAMBDA_HANDLER=HTTPSRequest.getHttps
48-
- make build_lambda_local SWIFT_EXECUTABLE=S3Test SWIFT_PROJECT_PATH=Examples/S3Test LAMBDA_FUNCTION_NAME=S3Test LAMBDA_HANDLER=S3Test.getObject
49-
- make start_docker_compose_env SWIFT_EXECUTABLE=S3Test SWIFT_PROJECT_PATH=Examples/S3Test LAMBDA_FUNCTION_NAME=S3Test LAMBDA_HANDLER=S3Test.getObject
50-
- make invoke_lambda_local SWIFT_EXECUTABLE=S3Test SWIFT_PROJECT_PATH=Examples/S3Test LAMBDA_FUNCTION_NAME=S3Test LAMBDA_HANDLER=S3Test.getObject
51-
- make stop_docker_compose_env SWIFT_EXECUTABLE=S3Test SWIFT_PROJECT_PATH=Examples/S3Test LAMBDA_FUNCTION_NAME=S3Test LAMBDA_HANDLER=S3Test.getObject
52-
- make test_lambda_local_output SWIFT_EXECUTABLE=S3Test SWIFT_PROJECT_PATH=Examples/S3Test LAMBDA_FUNCTION_NAME=S3Test LAMBDA_HANDLER=S3Test.getObject
53-
- make build_lambda_local SWIFT_EXECUTABLE=RedisDemo SWIFT_PROJECT_PATH=Examples/RedisDemo LAMBDA_FUNCTION_NAME=RedisDemo LAMBDA_HANDLER=$(SWIFT_EXECUTABLE).setGet
54-
- make start_docker_compose_env SWIFT_EXECUTABLE=RedisDemo SWIFT_PROJECT_PATH=Examples/RedisDemo LAMBDA_FUNCTION_NAME=RedisDemo LAMBDA_HANDLER=$(SWIFT_EXECUTABLE).setGet
55-
- make invoke_lambda_local SWIFT_EXECUTABLE=RedisDemo SWIFT_PROJECT_PATH=Examples/RedisDemo LAMBDA_FUNCTION_NAME=RedisDemo LAMBDA_HANDLER=$(SWIFT_EXECUTABLE).setGet
56-
- make stop_docker_compose_env SWIFT_EXECUTABLE=RedisDemo SWIFT_PROJECT_PATH=Examples/RedisDemo LAMBDA_FUNCTION_NAME=RedisDemo LAMBDA_HANDLER=$(SWIFT_EXECUTABLE).setGet
57-
- make test_lambda_local_output SWIFT_EXECUTABLE=RedisDemo SWIFT_PROJECT_PATH=Examples/RedisDemo LAMBDA_FUNCTION_NAME=RedisDemo LAMBDA_HANDLER=$(SWIFT_EXECUTABLE).setGet
58-
- make build_lambda_local SWIFT_EXECUTABLE=PostgreSQLDemo SWIFT_PROJECT_PATH=Examples/PostgreSQLDemo LAMBDA_FUNCTION_NAME=PostgreSQLDemo LAMBDA_HANDLER=$(SWIFT_EXECUTABLE).query
59-
- make start_docker_compose_env SWIFT_EXECUTABLE=PostgreSQLDemo SWIFT_PROJECT_PATH=Examples/PostgreSQLDemo LAMBDA_FUNCTION_NAME=PostgreSQLDemo LAMBDA_HANDLER=$(SWIFT_EXECUTABLE).query
60-
- make invoke_lambda_local SWIFT_EXECUTABLE=PostgreSQLDemo SWIFT_PROJECT_PATH=Examples/PostgreSQLDemo LAMBDA_FUNCTION_NAME=PostgreSQLDemo LAMBDA_HANDLER=$(SWIFT_EXECUTABLE).query
61-
- make stop_docker_compose_env SWIFT_EXECUTABLE=PostgreSQLDemo SWIFT_PROJECT_PATH=Examples/PostgreSQLDemo LAMBDA_FUNCTION_NAME=PostgreSQLDemo LAMBDA_HANDLER=$(SWIFT_EXECUTABLE).query
62-
- make test_lambda_local_output SWIFT_EXECUTABLE=PostgreSQLDemo SWIFT_PROJECT_PATH=Examples/PostgreSQLDemo LAMBDA_FUNCTION_NAME=PostgreSQLDemo LAMBDA_HANDLER=$(SWIFT_EXECUTABLE).query
6333

34+
env:
35+
- SWIFT_EXECUTABLE=HelloWorld SWIFT_PROJECT_PATH=Examples/HelloWorld LAMBDA_FUNCTION_NAME=HelloWorld LAMBDA_HANDLER=HelloWorld.helloWorld
36+
- SWIFT_EXECUTABLE=HTTPSRequest SWIFT_PROJECT_PATH=Examples/HTTPSRequest LAMBDA_FUNCTION_NAME=HTTPSRequest LAMBDA_HANDLER=HTTPSRequest.getHttps
37+
- SWIFT_EXECUTABLE=S3Test SWIFT_PROJECT_PATH=Examples/S3Test LAMBDA_FUNCTION_NAME=S3Test LAMBDA_HANDLER=S3Test.getObject
38+
- SWIFT_EXECUTABLE=RedisDemo SWIFT_PROJECT_PATH=Examples/RedisDemo LAMBDA_FUNCTION_NAME=RedisDemo LAMBDA_HANDLER=$(SWIFT_EXECUTABLE).setGet
39+
- SWIFT_EXECUTABLE=PostgreSQLDemo SWIFT_PROJECT_PATH=Examples/PostgreSQLDemo LAMBDA_FUNCTION_NAME=PostgreSQLDemo LAMBDA_HANDLER=$(SWIFT_EXECUTABLE).query
40+
41+
script:
42+
- make swift_test
43+
- make run_test_example
44+
6445
deploy:
6546
provider: releases
6647
api_key:
+97
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
{
2+
"object": {
3+
"pins": [
4+
{
5+
"package": "async-http-client",
6+
"repositoryURL": "https://github.com/swift-server/async-http-client.git",
7+
"state": {
8+
"branch": null,
9+
"revision": "037b70291941fe43de668066eb6fb802c5e181d2",
10+
"version": "1.1.1"
11+
}
12+
},
13+
{
14+
"package": "LambdaSwiftSprinter",
15+
"repositoryURL": "https://github.com/swift-sprinter/aws-lambda-swift-sprinter-core",
16+
"state": {
17+
"branch": null,
18+
"revision": "6941e41194bde0e57fb0deb23be620f2b8dd626d",
19+
"version": "1.0.0"
20+
}
21+
},
22+
{
23+
"package": "LambdaSwiftSprinterNioPlugin",
24+
"repositoryURL": "https://github.com/swift-sprinter/aws-lambda-swift-sprinter-nio-plugin",
25+
"state": {
26+
"branch": null,
27+
"revision": "35d3ab84bf83fc881844b5f7483cb2a1d942a23f",
28+
"version": "1.0.1"
29+
}
30+
},
31+
{
32+
"package": "postgres-nio",
33+
"repositoryURL": "https://github.com/vapor/postgres-nio.git",
34+
"state": {
35+
"branch": null,
36+
"revision": "a528171a580b56fc38fd505bdb7d5de73e68a69a",
37+
"version": "1.0.0-rc.2"
38+
}
39+
},
40+
{
41+
"package": "swift-crypto",
42+
"repositoryURL": "https://github.com/apple/swift-crypto.git",
43+
"state": {
44+
"branch": null,
45+
"revision": "d67ac68d09a95443303e9d6e37b34e7ba101d5f1",
46+
"version": "1.0.1"
47+
}
48+
},
49+
{
50+
"package": "swift-log",
51+
"repositoryURL": "https://github.com/apple/swift-log.git",
52+
"state": {
53+
"branch": null,
54+
"revision": "74d7b91ceebc85daf387ebb206003f78813f71aa",
55+
"version": "1.2.0"
56+
}
57+
},
58+
{
59+
"package": "swift-metrics",
60+
"repositoryURL": "https://github.com/apple/swift-metrics.git",
61+
"state": {
62+
"branch": null,
63+
"revision": "708b960b4605abb20bc55d65abf6bad607252200",
64+
"version": "2.0.0"
65+
}
66+
},
67+
{
68+
"package": "swift-nio",
69+
"repositoryURL": "https://github.com/apple/swift-nio.git",
70+
"state": {
71+
"branch": null,
72+
"revision": "e876fb37410e0036b98b5361bb18e6854739572b",
73+
"version": "2.16.0"
74+
}
75+
},
76+
{
77+
"package": "swift-nio-extras",
78+
"repositoryURL": "https://github.com/apple/swift-nio-extras.git",
79+
"state": {
80+
"branch": null,
81+
"revision": "b4dbfacff47fb8d0f9e0a422d8d37935a9f10570",
82+
"version": "1.4.0"
83+
}
84+
},
85+
{
86+
"package": "swift-nio-ssl",
87+
"repositoryURL": "https://github.com/apple/swift-nio-ssl.git",
88+
"state": {
89+
"branch": null,
90+
"revision": "ae213938e151964aa691f0e902462fbe06baeeb6",
91+
"version": "2.7.1"
92+
}
93+
}
94+
]
95+
},
96+
"version": 1
97+
}

Examples/PostgreSQLDemo/Tests/PostgreSQLDemoTests/PostgreSQLDemoTests.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ final class PostgreSQLDemoTests: XCTestCase {
2525

2626
let data = pipe.fileHandleForReading.readDataToEndOfFile()
2727
let output = String(data: data, encoding: .utf8)
28+
let isError = output?.contains("unknown(host: \"postgres\", port: 5432)\n")
2829

29-
XCTAssertEqual(output, "Hello, world!\n")
30+
XCTAssertEqual(isError, true)
3031
}
3132

3233
/// Returns path to the built products directory.

Examples/RedisDemo/Tests/RedisDemoTests/RedisDemoTests.swift

+4-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ final class RedisDemoTests: XCTestCase {
1212
return
1313
}
1414

15-
let fooBinary = productsDirectory.appendingPathComponent("aws-lambda-swift-sprinter-redis")
15+
let fooBinary = productsDirectory.appendingPathComponent("RedisDemo")
1616

1717
let process = Process()
1818
process.executableURL = fooBinary
@@ -26,7 +26,9 @@ final class RedisDemoTests: XCTestCase {
2626
let data = pipe.fileHandleForReading.readDataToEndOfFile()
2727
let output = String(data: data, encoding: .utf8)
2828

29-
XCTAssertEqual(output, "Hello, world!\n")
29+
let isError = output?.contains("missingEnvironmentVariables(LambdaSwiftSprinter.Context.AWSEnvironmentKey.lambdaRuntimeApi)")
30+
31+
XCTAssertEqual(isError, true)
3032
}
3133

3234
/// Returns path to the built products directory.

Examples/S3Test/Package.resolved

+106
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
{
2+
"object": {
3+
"pins": [
4+
{
5+
"package": "async-http-client",
6+
"repositoryURL": "https://github.com/swift-server/async-http-client.git",
7+
"state": {
8+
"branch": null,
9+
"revision": "037b70291941fe43de668066eb6fb802c5e181d2",
10+
"version": "1.1.1"
11+
}
12+
},
13+
{
14+
"package": "LambdaSwiftSprinter",
15+
"repositoryURL": "https://github.com/swift-sprinter/aws-lambda-swift-sprinter-core",
16+
"state": {
17+
"branch": null,
18+
"revision": "6941e41194bde0e57fb0deb23be620f2b8dd626d",
19+
"version": "1.0.0"
20+
}
21+
},
22+
{
23+
"package": "LambdaSwiftSprinterNioPlugin",
24+
"repositoryURL": "https://github.com/swift-sprinter/aws-lambda-swift-sprinter-nio-plugin",
25+
"state": {
26+
"branch": null,
27+
"revision": "35d3ab84bf83fc881844b5f7483cb2a1d942a23f",
28+
"version": "1.0.1"
29+
}
30+
},
31+
{
32+
"package": "aws-sdk-swift",
33+
"repositoryURL": "https://github.com/swift-aws/aws-sdk-swift.git",
34+
"state": {
35+
"branch": null,
36+
"revision": "eeb30fac3d95a377d8c5bb4b33efed932061f42d",
37+
"version": "5.0.0-alpha.3"
38+
}
39+
},
40+
{
41+
"package": "aws-sdk-swift-core",
42+
"repositoryURL": "https://github.com/swift-aws/aws-sdk-swift-core.git",
43+
"state": {
44+
"branch": null,
45+
"revision": "ccea4b98758e9e8bb907a4dc9bb15d01d8a3c736",
46+
"version": "5.0.0-alpha.3.2"
47+
}
48+
},
49+
{
50+
"package": "swift-crypto",
51+
"repositoryURL": "https://github.com/apple/swift-crypto.git",
52+
"state": {
53+
"branch": null,
54+
"revision": "d67ac68d09a95443303e9d6e37b34e7ba101d5f1",
55+
"version": "1.0.1"
56+
}
57+
},
58+
{
59+
"package": "swift-log",
60+
"repositoryURL": "https://github.com/apple/swift-log.git",
61+
"state": {
62+
"branch": null,
63+
"revision": "74d7b91ceebc85daf387ebb206003f78813f71aa",
64+
"version": "1.2.0"
65+
}
66+
},
67+
{
68+
"package": "swift-nio",
69+
"repositoryURL": "https://github.com/apple/swift-nio.git",
70+
"state": {
71+
"branch": null,
72+
"revision": "40bdad80882d307abe2c0bb36cf3bd4d3e03fe04",
73+
"version": "2.16.1"
74+
}
75+
},
76+
{
77+
"package": "swift-nio-extras",
78+
"repositoryURL": "https://github.com/apple/swift-nio-extras.git",
79+
"state": {
80+
"branch": null,
81+
"revision": "e0e76733600a2806b3dc4feae8cfebace858c1a2",
82+
"version": "1.4.1"
83+
}
84+
},
85+
{
86+
"package": "swift-nio-ssl",
87+
"repositoryURL": "https://github.com/apple/swift-nio-ssl.git",
88+
"state": {
89+
"branch": null,
90+
"revision": "ae213938e151964aa691f0e902462fbe06baeeb6",
91+
"version": "2.7.1"
92+
}
93+
},
94+
{
95+
"package": "swift-nio-transport-services",
96+
"repositoryURL": "https://github.com/apple/swift-nio-transport-services.git",
97+
"state": {
98+
"branch": null,
99+
"revision": "85a67aea7caf5396ed599543dd23cffeb6dbbf96",
100+
"version": "1.5.1"
101+
}
102+
}
103+
]
104+
},
105+
"version": 1
106+
}

Makefile

+3-1
Original file line numberDiff line numberDiff line change
@@ -261,4 +261,6 @@ stop_docker_compose_env:
261261
make -f $(SWIFT_PROJECT_PATH)/Makefile stop_docker_compose_env
262262

263263
test_lambda_local_output:
264-
cmp $(TMP_BUILD_PATH)/outfile $(SWIFT_PROJECT_PATH)/outfile.json
264+
cmp $(TMP_BUILD_PATH)/outfile $(SWIFT_PROJECT_PATH)/outfile.json
265+
266+
run_test_example: build_lambda_local start_docker_compose_env invoke_lambda_local stop_docker_compose_env test_lambda_local_output

0 commit comments

Comments
 (0)