Skip to content

Commit a69b2d0

Browse files
committed
Remove more environment variables when launching inferior swift-test binaries from Xcode, so they don't hang while trying to connect to Xcode. There is already a superior xctest invocation that's using them, and we need to make sure we're not passing them on so that the xctest invocation being invoked by swift-test thinks it's invoked directly from Xcode. We should possibly be filtering out all environment variables prefixed with "XCTest", or maybe even better, use an allow-list of environment variables to avoid having the environment leaking into the test.
rdar://68362616
1 parent f81e902 commit a69b2d0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Sources/TSCTestSupport/Product.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ extension Product {
8989
#if Xcode
9090
// Unset these variables which causes issues when running tests via Xcode.
9191
environment["XCTestConfigurationFilePath"] = nil
92+
environment["XCTestSessionIdentifier"] = nil
93+
environment["XCTestBundlePath"] = nil
9294
environment["NSUnbufferedIO"] = nil
9395
#endif
9496
// FIXME: We use this private environment variable hack to be able to

0 commit comments

Comments
 (0)