Skip to content

Commit

Permalink
allow remote xctest connections w/ a flag
Browse files Browse the repository at this point in the history
  • Loading branch information
herval committed Dec 11, 2024
1 parent 8a1d5cd commit edef9bf
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ enum Route: String, CaseIterable {

struct XCTestHTTPServer {
func start() async throws {
let port = ProcessInfo.processInfo.environment["PORT"]?.toUInt16()
let port = ProcessInfo.processInfo.environment["PORT"]?.toUInt16() ?? 22087

let acceptRemoteConnections = ProcessInfo.processInfo.environment["ACCEPT_REMOTE_CONNECTIONS"] == "true"

let address = acceptRemoteConnections ? .inet(port: port) : .loopback(port: port)
let server = HTTPServer(address: acceptRemoteConnections ? .inet6(port: port) : .loopback(port: port))

for route in Route.allCases {
let handler = await RouteHandlerFactory.createRouteHandler(route: route)
Expand Down

0 comments on commit edef9bf

Please sign in to comment.