From b1f8f976c0ff94f72eba1fdcfc13a792d939cbec Mon Sep 17 00:00:00 2001 From: Bruno Coelho <4brunu@users.noreply.github.com> Date: Thu, 12 Jan 2023 15:10:15 +0000 Subject: [PATCH] [swift5][client] - enable swift unit tests (#14441) --- .../alamofireLibrary/SwaggerClientTests/run_xcodebuild.sh | 2 +- .../SwaggerClientTests/SwaggerClientTests/APIHelperTests.swift | 3 ++- .../asyncAwaitLibrary/SwaggerClientTests/run_xcodebuild.sh | 2 +- .../SwaggerClientTests/SwaggerClientTests/APIHelperTests.swift | 3 ++- .../swift5/combineLibrary/SwaggerClientTests/run_xcodebuild.sh | 2 +- .../swift5/default/SwaggerClientTests/run_xcodebuild.sh | 2 +- .../promisekitLibrary/SwaggerClientTests/run_xcodebuild.sh | 2 +- .../SwaggerClientTests/SwaggerClientTests/APIHelperTests.swift | 3 ++- .../swift5/rxswiftLibrary/SwaggerClientTests/run_xcodebuild.sh | 2 +- .../urlsessionLibrary/SwaggerClientTests/run_xcodebuild.sh | 2 +- 10 files changed, 13 insertions(+), 10 deletions(-) diff --git a/samples/client/petstore/swift5/alamofireLibrary/SwaggerClientTests/run_xcodebuild.sh b/samples/client/petstore/swift5/alamofireLibrary/SwaggerClientTests/run_xcodebuild.sh index 2d5643891a8..29969d0f637 100755 --- a/samples/client/petstore/swift5/alamofireLibrary/SwaggerClientTests/run_xcodebuild.sh +++ b/samples/client/petstore/swift5/alamofireLibrary/SwaggerClientTests/run_xcodebuild.sh @@ -1,3 +1,3 @@ #!/bin/sh -xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 14,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} +xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 14,OS=latest" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 14,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/SwaggerClientTests/SwaggerClientTests/APIHelperTests.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/SwaggerClientTests/SwaggerClientTests/APIHelperTests.swift index 4f51881a666..e2be777235e 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/SwaggerClientTests/SwaggerClientTests/APIHelperTests.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/SwaggerClientTests/SwaggerClientTests/APIHelperTests.swift @@ -46,7 +46,8 @@ class APIHelperTests: XCTestCase { func testMapValuesToQueryItems() { let source: [String: Any] = ["a": 1, "c": ["1", nil, "2"], "d": true, "e": false] let expected: [URLQueryItem] = [URLQueryItem(name: "a", value: "1"), - URLQueryItem(name: "c", value: "1,2"), + URLQueryItem(name: "c", value: "1"), + URLQueryItem(name: "c", value: "2"), URLQueryItem(name: "d", value: "true"), URLQueryItem(name: "e", value: "false")].sorted(by: { $0.name > $1.name }) let actual: [URLQueryItem] = APIHelper.mapValuesToQueryItems(source)!.sorted(by: { $0.name > $1.name }) diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/SwaggerClientTests/run_xcodebuild.sh b/samples/client/petstore/swift5/asyncAwaitLibrary/SwaggerClientTests/run_xcodebuild.sh index 2d5643891a8..29969d0f637 100755 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/SwaggerClientTests/run_xcodebuild.sh +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/SwaggerClientTests/run_xcodebuild.sh @@ -1,3 +1,3 @@ #!/bin/sh -xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 14,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} +xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 14,OS=latest" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 14,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} diff --git a/samples/client/petstore/swift5/combineLibrary/SwaggerClientTests/SwaggerClientTests/APIHelperTests.swift b/samples/client/petstore/swift5/combineLibrary/SwaggerClientTests/SwaggerClientTests/APIHelperTests.swift index 4f51881a666..e2be777235e 100644 --- a/samples/client/petstore/swift5/combineLibrary/SwaggerClientTests/SwaggerClientTests/APIHelperTests.swift +++ b/samples/client/petstore/swift5/combineLibrary/SwaggerClientTests/SwaggerClientTests/APIHelperTests.swift @@ -46,7 +46,8 @@ class APIHelperTests: XCTestCase { func testMapValuesToQueryItems() { let source: [String: Any] = ["a": 1, "c": ["1", nil, "2"], "d": true, "e": false] let expected: [URLQueryItem] = [URLQueryItem(name: "a", value: "1"), - URLQueryItem(name: "c", value: "1,2"), + URLQueryItem(name: "c", value: "1"), + URLQueryItem(name: "c", value: "2"), URLQueryItem(name: "d", value: "true"), URLQueryItem(name: "e", value: "false")].sorted(by: { $0.name > $1.name }) let actual: [URLQueryItem] = APIHelper.mapValuesToQueryItems(source)!.sorted(by: { $0.name > $1.name }) diff --git a/samples/client/petstore/swift5/combineLibrary/SwaggerClientTests/run_xcodebuild.sh b/samples/client/petstore/swift5/combineLibrary/SwaggerClientTests/run_xcodebuild.sh index 2d5643891a8..29969d0f637 100755 --- a/samples/client/petstore/swift5/combineLibrary/SwaggerClientTests/run_xcodebuild.sh +++ b/samples/client/petstore/swift5/combineLibrary/SwaggerClientTests/run_xcodebuild.sh @@ -1,3 +1,3 @@ #!/bin/sh -xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 14,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} +xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 14,OS=latest" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 14,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} diff --git a/samples/client/petstore/swift5/default/SwaggerClientTests/run_xcodebuild.sh b/samples/client/petstore/swift5/default/SwaggerClientTests/run_xcodebuild.sh index 2d5643891a8..29969d0f637 100755 --- a/samples/client/petstore/swift5/default/SwaggerClientTests/run_xcodebuild.sh +++ b/samples/client/petstore/swift5/default/SwaggerClientTests/run_xcodebuild.sh @@ -1,3 +1,3 @@ #!/bin/sh -xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 14,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} +xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 14,OS=latest" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 14,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} diff --git a/samples/client/petstore/swift5/promisekitLibrary/SwaggerClientTests/run_xcodebuild.sh b/samples/client/petstore/swift5/promisekitLibrary/SwaggerClientTests/run_xcodebuild.sh index 2d5643891a8..29969d0f637 100755 --- a/samples/client/petstore/swift5/promisekitLibrary/SwaggerClientTests/run_xcodebuild.sh +++ b/samples/client/petstore/swift5/promisekitLibrary/SwaggerClientTests/run_xcodebuild.sh @@ -1,3 +1,3 @@ #!/bin/sh -xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 14,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} +xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 14,OS=latest" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 14,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} diff --git a/samples/client/petstore/swift5/rxswiftLibrary/SwaggerClientTests/SwaggerClientTests/APIHelperTests.swift b/samples/client/petstore/swift5/rxswiftLibrary/SwaggerClientTests/SwaggerClientTests/APIHelperTests.swift index 4f51881a666..e2be777235e 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/SwaggerClientTests/SwaggerClientTests/APIHelperTests.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/SwaggerClientTests/SwaggerClientTests/APIHelperTests.swift @@ -46,7 +46,8 @@ class APIHelperTests: XCTestCase { func testMapValuesToQueryItems() { let source: [String: Any] = ["a": 1, "c": ["1", nil, "2"], "d": true, "e": false] let expected: [URLQueryItem] = [URLQueryItem(name: "a", value: "1"), - URLQueryItem(name: "c", value: "1,2"), + URLQueryItem(name: "c", value: "1"), + URLQueryItem(name: "c", value: "2"), URLQueryItem(name: "d", value: "true"), URLQueryItem(name: "e", value: "false")].sorted(by: { $0.name > $1.name }) let actual: [URLQueryItem] = APIHelper.mapValuesToQueryItems(source)!.sorted(by: { $0.name > $1.name }) diff --git a/samples/client/petstore/swift5/rxswiftLibrary/SwaggerClientTests/run_xcodebuild.sh b/samples/client/petstore/swift5/rxswiftLibrary/SwaggerClientTests/run_xcodebuild.sh index 2d5643891a8..29969d0f637 100755 --- a/samples/client/petstore/swift5/rxswiftLibrary/SwaggerClientTests/run_xcodebuild.sh +++ b/samples/client/petstore/swift5/rxswiftLibrary/SwaggerClientTests/run_xcodebuild.sh @@ -1,3 +1,3 @@ #!/bin/sh -xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 14,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} +xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 14,OS=latest" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 14,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} diff --git a/samples/client/petstore/swift5/urlsessionLibrary/SwaggerClientTests/run_xcodebuild.sh b/samples/client/petstore/swift5/urlsessionLibrary/SwaggerClientTests/run_xcodebuild.sh index 2d5643891a8..29969d0f637 100755 --- a/samples/client/petstore/swift5/urlsessionLibrary/SwaggerClientTests/run_xcodebuild.sh +++ b/samples/client/petstore/swift5/urlsessionLibrary/SwaggerClientTests/run_xcodebuild.sh @@ -1,3 +1,3 @@ #!/bin/sh -xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 14,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} +xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 14,OS=latest" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 14,OS=latest" | xcpretty && exit ${PIPESTATUS[0]}