Skip to content

Commit 554a6d9

Browse files
committed
fix tests running against linux by just grabbing spec files to test against and storing them in-repo
1 parent c72fad4 commit 554a6d9

12 files changed

Lines changed: 69060 additions & 16 deletions

Tests/OpenAPIKit30RealSpecSuite/GitHubAPITests.swift

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,13 @@ final class GitHubAPICampatibilityTests: XCTestCase {
3030
githubAPI = Result {
3131
try YAMLDecoder().decode(
3232
OpenAPI.Document.self,
33-
from: String(contentsOf: URL(string: "https://raw.githubusercontent.com/github/rest-api-description/e4f28959fbc6c9fc4eea823b495061dded87e84d/descriptions/ghes-3.0/ghes-3.0.yaml")!)
33+
from: String(contentsOf: URL(filePath: "../inputs/ghes-3.0.yaml"), encoding: .utf8)
3434
)
3535
}
3636
}
3737
}
3838

3939
func test_successfullyParsedDocument() throws {
40-
#if os(Linux)
41-
throw XCTSkip("Swift bug causes CI failure currently (line 48): failed - The operation could not be completed. The file doesn’t exist.")
42-
#endif
4340
switch githubAPI {
4441
case nil:
4542
XCTFail("Did not attempt to pull GitHub API documentation like expected.")

Tests/OpenAPIKit30RealSpecSuite/GoogleBooksAPITests.swift

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,13 @@ final class GoogleBooksAPICampatibilityTests: XCTestCase {
2525
booksAPI = Result {
2626
try YAMLDecoder().decode(
2727
OpenAPI.Document.self,
28-
from: String(contentsOf: URL(string: "https://raw.githubusercontent.com/APIs-guru/openapi-directory/master/APIs/googleapis.com/books/v1/openapi.yaml")!)
28+
from: String(contentsOf: URL(filePath: "../inputs/google-books-3.0.yaml"), encoding: .utf8)
2929
)
3030
}
3131
}
3232
}
3333

3434
func test_successfullyParsedDocument() throws {
35-
#if os(Linux)
36-
throw XCTSkip("Swift bug causes CI failure currently (line 48): failed - The operation could not be completed. The file doesn’t exist.")
37-
#endif
3835
switch booksAPI {
3936
case nil:
4037
XCTFail("Did not attempt to pull Google Books API documentation like expected.")

Tests/OpenAPIKit30RealSpecSuite/PetStoreAPITests.swift

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,13 @@ final class PetStoreAPICampatibilityTests: XCTestCase {
2525
petStoreAPI = Result {
2626
try YAMLDecoder().decode(
2727
OpenAPI.Document.self,
28-
from: String(contentsOf: URL(string: "https://raw.githubusercontent.com/swagger-api/swagger-petstore/master/src/main/resources/openapi.yaml")!)
28+
from: String(contentsOf: URL(filePath: "../inputs/pet-store-3.0.yaml"), encoding: .utf8)
2929
)
3030
}
3131
}
3232
}
3333

3434
func test_successfullyParsedDocument() throws {
35-
#if os(Linux)
36-
throw XCTSkip("Swift bug causes CI failure currently (line 48): failed - The operation could not be completed. The file doesn’t exist.")
37-
#endif
3835
switch petStoreAPI {
3936
case nil:
4037
XCTFail("Did not attempt to pull Pet Store API documentation like expected.")

Tests/OpenAPIKit30RealSpecSuite/TomTomAPITests.swift

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,13 @@ final class TomTomAPICampatibilityTests: XCTestCase {
2525
tomtomAPI = Result {
2626
try YAMLDecoder().decode(
2727
OpenAPI.Document.self,
28-
from: String(contentsOf: URL(string: "https://raw.githubusercontent.com/APIs-guru/openapi-directory/c9190db19e5cb151592d44f0d4482839e1e5a8e0/APIs/tomtom.com/search/1.0.0/openapi.yaml")!)
28+
from: String(contentsOf: URL(filePath: "../inputs/tomtom-3.0.yaml"), encoding: .utf8)
2929
)
3030
}
3131
}
3232
}
3333

3434
func test_successfullyParsedDocument() throws {
35-
#if os(Linux)
36-
throw XCTSkip("Swift bug causes CI failure currently (line 43): failed - The operation could not be completed. The file doesn’t exist.")
37-
#endif
3835
switch tomtomAPI {
3936
case nil:
4037
XCTFail("Did not attempt to pull TomTom API documentation like expected.")

Tests/inputs/ghes-3.0-LICENSE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 GitHub
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)