Skip to content

Commit ef82b6a

Browse files
committed
Workaround for broken current work directory scheme in Xcode 26.4
1 parent 096e39d commit ef82b6a

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

Tests/AppTests/Helpers/DatabasePoolSetupTrait.swift

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,25 @@
1313
// limitations under the License.
1414

1515
import Testing
16+
import Foundation
1617

1718

1819
struct DatabasePoolSetupTrait: SuiteTrait, TestScoping {
1920
func provideScope(for test: Test, testCase: Test.Case?, performing function: @Sendable () async throws -> Void) async throws {
21+
22+
#if os(macOS)
23+
// sas 2026-04-07: Setting the working directory in the scheme is broken in Xcode 26.4.
24+
// Since we need to read .env files, we need to change the working directory manually for now as a work-around.
25+
_ = FileManager.default.changeCurrentDirectoryPath(
26+
URL(filePath: #filePath)
27+
.deletingLastPathComponent()
28+
.deletingLastPathComponent()
29+
.deletingLastPathComponent()
30+
.deletingLastPathComponent()
31+
.path(percentEncoded: false)
32+
)
33+
#endif
34+
2035
try await DatabasePool.shared.setUp()
2136
try await function()
2237
try await DatabasePool.shared.tearDown()

0 commit comments

Comments
 (0)