Skip to content

Commit da5da8e

Browse files
authored
Merge pull request #2351 from bnbarham/skip-amazon-linux
Temporarily skip macro tests on Amazon Linux
2 parents 3556c57 + d046c7b commit da5da8e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Sources/SKTestSupport/SkipUnless.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,16 @@ package actor SkipUnless {
129129
try XCTSkipUnless(Platform.current == .windows, message)
130130
}
131131

132+
package static func platformIsNotAmazonLinux(_ message: String) throws {
133+
guard Platform.current == .linux,
134+
let release = try? String(contentsOf: URL(filePath: "/etc/system-release"), encoding: .utf8)
135+
else {
136+
return
137+
}
138+
139+
try XCTSkipUnless(!release.hasPrefix("Amazon"), message)
140+
}
141+
132142
package static func platformSupportsTaskPriorityElevation() throws {
133143
#if os(macOS)
134144
guard #available(macOS 14.0, *) else {
@@ -149,6 +159,7 @@ package actor SkipUnless {
149159
Platform.current != .windows,
150160
"Temporarily skipping as we need to fix these tests to use the cmake-built swift-syntax libraries on Windows."
151161
)
162+
try SkipUnless.platformIsNotAmazonLinux("https://github.com/swiftlang/sourcekit-lsp/issues/2350")
152163

153164
return try await shared.skipUnlessSupported(file: file, line: line) {
154165
do {

0 commit comments

Comments
 (0)