Skip to content

Commit 1beb6ea

Browse files
authored
Skip large file copy test in GitHub actions (#451)
1 parent 0971657 commit 1beb6ea

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

Sources/SWBTestSupport/SkippedTestSupport.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,10 @@ extension Trait where Self == Testing.ConditionTrait {
172172
#endif
173173
}
174174

175+
package static func skipInGitHubActions(_ comment: Comment? = nil) -> Self {
176+
return .skipIfEnvironmentVariableSet(key: "GITHUB_ACTIONS")
177+
}
178+
175179
package static func requireClangFeatures(_ requiredFeatures: DiscoveredClangToolSpecInfo.FeatureFlag...) -> Self {
176180
enabled("Clang compiler does not support features: \(requiredFeatures)") {
177181
let features = try await ConditionTraitContext.shared.clangFeatures
@@ -235,8 +239,8 @@ extension Trait where Self == Testing.ConditionTrait {
235239
}
236240
}
237241

238-
package static func skipIfEnvironmentVariableSet(key: EnvironmentKey) -> Self {
239-
disabled("environment sets '\(key)'") {
242+
package static func skipIfEnvironmentVariableSet(key: EnvironmentKey, _ comment: Comment? = nil) -> Self {
243+
disabled(comment ?? "environment sets '\(key)'") {
240244
getEnvironmentVariable(key) != nil
241245
}
242246
}

Tests/SWBTaskExecutionTests/PBXCpTests.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,8 @@ fileprivate struct PBXCpTests: CoreBasedTests {
442442
fileprivate let buffer0 = [UInt8](repeating: 0xAA, count: 1024 * 513)
443443
fileprivate let buffer1 = [UInt8](repeating: 0x55, count: 1024 * 513)
444444

445-
@Test(.skipHostOS(.windows, "LocalFS needs to use stat64 on windows...."))
445+
@Test(.skipHostOS(.windows, "LocalFS needs to use stat64 on windows...."),
446+
.skipInGitHubActions("GitHub action runners do not have enough storage space for this test"))
446447
func largerFile() async throws {
447448
try await withTemporaryDirectory { tmp in
448449
// Test copying a large file.

0 commit comments

Comments
 (0)