Skip to content

Commit b60528e

Browse files
authored
Remove a couple areas where tests where changing cwd (fixes AL2 crashes) (#9505)
Fix crashes on AL2 where tests where changing current working directory
1 parent 1fb32b5 commit b60528e

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

Tests/IntegrationTests/BasicTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ private struct BasicTests {
6969
#expect(dealerOutput.filter(\.isPlayingCardSuit).count == 10)
7070

7171
// Verify that the 'git status' is clean after a build.
72-
let gitOutput = try sh("git\(ProcessInfo.exeSuffix)", "status", workingDirectory: packagePath).stdout
72+
let gitOutput = try sh("git\(ProcessInfo.exeSuffix)", "-C", packagePath, "status").stdout
7373
#expect(gitOutput.contains("nothing to commit, working tree clean"))
7474

7575
// Verify that another 'swift build' does nothing.

Tests/SwiftPMBuildServerTests/BuildServerTests.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ fileprivate func withSwiftPMBSP(fixtureName: String, body: (Connection, Notifica
4141
bspProcess.standardInput = outPipe
4242
let execPath = SwiftPM.xctestBinaryPath(for: "swift-package").pathString
4343
bspProcess.executableURL = URL(filePath: execPath)
44-
bspProcess.arguments = ["experimental-build-server", "--build-system", "swiftbuild"]
45-
bspProcess.currentDirectoryURL = URL(filePath: fixture.pathString)
44+
bspProcess.arguments = ["--package-path", fixture.pathString, "experimental-build-server", "--build-system", "swiftbuild"]
4645
async let terminationPromise: Void = try await bspProcess.run()
4746
let notificationCollector = NotificationCollectingMessageHandler()
4847
connection.start(receiveHandler: notificationCollector)

0 commit comments

Comments
 (0)