Skip to content

Play your own Switch games on iPhone/iPad — one-click macOS app, no terminal. | 把 Switch 游戏装进 iPhone:图形界面一键构建,不用命令行。Bring your own game.

Give the end-to-end library build test 30 seconds on CI

v0lumehib28fd2e78318
diff --git a/frontend/Tests/NSPortBuilderTests/LibraryTests.swift b/frontend/Tests/NSPortBuilderTests/LibraryTests.swift
index 7fd751ae..0feca325 100644
--- a/frontend/Tests/NSPortBuilderTests/LibraryTests.swift
+++ b/frontend/Tests/NSPortBuilderTests/LibraryTests.swift
@@ -269,11 +269,11 @@ final class LibraryTests: XCTestCase {
let running = expectation(description: "The stage is reported")
let started = model.$stages.filter { $0.first?.percent == 25 }.prefix(1).sink { _ in running.fulfill() }
model.startBuild()
- wait(for: [running], timeout: 10)
+ wait(for: [running], timeout: 30) // a CI runner starts the script slowly
let stopped = expectation(description: "The build ends")
let ended = model.$running.dropFirst().filter { !$0 }.prefix(1).sink { _ in stopped.fulfill() }
model.stop()
- wait(for: [stopped], timeout: 10)
+ wait(for: [stopped], timeout: 30)
withExtendedLifetime((started, ended)) {}
RunLoop.main.run(until: Date().addingTimeInterval(0.1))
XCTAssertTrue(model.stages.isEmpty)
@@ -729,11 +729,11 @@ final class LibraryTests: XCTestCase {
XCTAssertTrue(model.canBuild)
window.orderOut(nil) // Registration must work even while the launcher is hidden.
model.startBuild()
- wait(for: [completed], timeout: 10)
+ wait(for: [completed], timeout: 30) // a CI runner runs the script slowly
withExtendedLifetime(token) {}
// The library can list the app before the model has taken in the script's exit (a slower Mac, CI): wait for both
let settled = XCTNSPredicateExpectation(predicate: NSPredicate { _, _ in model.done && !model.running }, object: nil)
- wait(for: [settled], timeout: 10)
+ wait(for: [settled], timeout: 30)
XCTAssertTrue(model.done)
XCTAssertFalse(model.running)
XCTAssertEqual(model.stages.map(\.name), ["Mac app"]) // from the JSON events, which the log shows as text