Skip to content

Commit

Permalink
ci: Update to Swift 4.2.3, use official Docker images (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
djones6 authored and kilnerm committed Apr 3, 2019
1 parent c383584 commit 7e4fa66
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 37 deletions.
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.2.1
4.2.3
23 changes: 11 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,27 @@ branches:
matrix:
include:
- os: linux
dist: trusty
dist: xenial
sudo: required
env: SWIFT_SNAPSHOT=4.0.3
- os: linux
dist: trusty
sudo: required
env: SWIFT_SNAPSHOT=4.1.3
services: docker
env: DOCKER_IMAGE=swift:4.0.3 SWIFT_SNAPSHOT=4.0.3
- os: linux
dist: trusty
dist: xenial
sudo: required
services: docker
env: DOCKER_IMAGE=swift:4.1.3 SWIFT_SNAPSHOT=4.1.3
- os: linux
dist: trusty
dist: xenial
sudo: required
services: docker
env: DOCKER_IMAGE=ubuntu:16.04
env: DOCKER_IMAGE=swift:4.2.3
- os: linux
dist: trusty
dist: xenial
sudo: required
services: docker
env: DOCKER_IMAGE=ubuntu:16.04 SWIFT_SNAPSHOT=$SWIFT_DEVELOPMENT_SNAPSHOT
env: DOCKER_IMAGE=swift:4.2.3 SWIFT_SNAPSHOT=$SWIFT_DEVELOPMENT_SNAPSHOT
- os: linux
dist: trusty
dist: xenial
sudo: required
services: docker
env: DOCKER_IMAGE=ubuntu:18.04
Expand Down
48 changes: 24 additions & 24 deletions Tests/SwiftyRequestTests/SwiftyRequestTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class SwiftyRequestTests: XCTestCase {
("testResponseData", testResponseData),
("testResponseObject", testResponseObject),
("testQueryObject", testQueryObject),
("testResponseArray", testResponseArray),
// ("testResponseArray", testResponseArray),
("testResponseString", testResponseString),
("testResponseVoid", testResponseVoid),
("testFileDownload", testFileDownload),
Expand Down Expand Up @@ -299,29 +299,29 @@ class SwiftyRequestTests: XCTestCase {

waitForExpectations(timeout: 10)
}

func testResponseArray() {

let expectation = self.expectation(description: "responseArray SwiftyRequest test")

let request = RestRequest(url: geolookupURL)
request.credentials = .apiKey

request.responseArray(responseToError: responseToError,
path: ["location", "nearby_weather_stations", "airport", "station"]) { (response: RestResponse<[GeoLookupModel]>) in
switch response.result {
case .success(let retval):
XCTAssertGreaterThan(retval.count, 0)
XCTAssertGreaterThan(retval[0].city.count, 0)
case .failure(let error):
XCTFail("Failed to get weather response array with error: \(error)")
}
expectation.fulfill()
}

waitForExpectations(timeout: 10)

}
// NOTE: Commented out test as it uses an expired API Key, issue raised: https://github.com/IBM-Swift/SwiftyRequest/issues/55
// func testResponseArray() {
//
// let expectation = self.expectation(description: "responseArray SwiftyRequest test")
//
// let request = RestRequest(url: geolookupURL)
// request.credentials = .apiKey
//
// request.responseArray(responseToError: responseToError,
// path: ["location", "nearby_weather_stations", "airport", "station"]) { (response: RestResponse<[GeoLookupModel]>) in
// switch response.result {
// case .success(let retval):
// XCTAssertGreaterThan(retval.count, 0)
// XCTAssertGreaterThan(retval[0].city.count, 0)
// case .failure(let error):
// XCTFail("Failed to get weather response array with error: \(error)")
// }
// expectation.fulfill()
// }
//
// waitForExpectations(timeout: 10)
//
// }

func assertCharsetISO8859(response: HTTPURLResponse?) {
guard let text = response?.allHeaderFields["Content-Type"] as? String,
Expand Down

0 comments on commit 7e4fa66

Please sign in to comment.