Skip to content

Commit a678e46

Browse files
committed
Enable some skipped tests
Some of these were formerly skipped in GitHub actions, but are passing now. Likely the culprit was ServiceConsoleTests.serviceShutdown all along, which is fixed in #673
1 parent ff9c29c commit a678e46

File tree

7 files changed

+26
-13
lines changed

7 files changed

+26
-13
lines changed

Tests/SWBTaskExecutionTests/PBXCpTests.swift

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -442,21 +442,32 @@ 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...."),
446-
.skipInGitHubActions("GitHub action runners do not have enough storage space for this test"))
445+
@Test
447446
func largerFile() async throws {
448-
try await withTemporaryDirectory { tmp in
447+
let iterationCount = 4096
448+
let buffers = buffer0 + buffer1
449+
let requiredSpace = ByteCount(Int64(buffers.count * (iterationCount + 1) * 2 * 2))
450+
let fs = localFS
451+
try await withTemporaryDirectory(fs: fs) { tmp in
452+
// If the available free disk space on this filesystem is less than twice the amount of data the test is expected to write (2 copies of the file times 2), skip it
453+
if let freeSpace = try fs.getFreeDiskSpace(tmp), freeSpace < requiredSpace {
454+
withKnownIssue {
455+
Issue.record("There is not enough free disk space to run this test (required: \(requiredSpace), free: \(freeSpace))")
456+
return
457+
}
458+
}
459+
449460
// Test copying a large file.
450461
let src = tmp.join("src")
451462
let sName = src.join("file")
452463
let dst = tmp.join("dst")
453464
let dName = dst.join("file")
454-
let fs = localFS
465+
455466

456467
try fs.createDirectory(src, recursive: true)
457468
var size = 0
458469
try await fs.write(sName) { fd in
459-
for _ in 0...4096 {
470+
for _ in 0...iterationCount {
460471
size += try fd.writeAll(buffer0)
461472
size += try fd.writeAll(buffer1)
462473
}
@@ -470,8 +481,10 @@ fileprivate struct PBXCpTests: CoreBasedTests {
470481
"copying src/...\n copying file...\n \(size) bytes\n"
471482
))
472483
// Check permissions
473-
let dstPerm = try fs.getFilePermissions(dName)
474-
#expect(dstPerm == 0o644) // files are created with u+rw, g+wr, o+rw (and +x if src is executable) permissions and umask will adjust
484+
if try ProcessInfo.processInfo.hostOperatingSystem() != .windows {
485+
let dstPerm = try fs.getFilePermissions(dName)
486+
#expect(dstPerm == 0o644) // files are created with u+rw, g+wr, o+rw (and +x if src is executable) permissions and umask will adjust
487+
}
475488
#expect(FileManager.default.contentsEqual(atPath: sName.str, andPath: dName.str))
476489
}
477490
}

Tests/SwiftBuildTests/ConsoleCommands/BuildCommandTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import SWBUtil
1717
import Testing
1818
import SwiftBuildTestSupport
1919

20-
@Suite(.skipHostOS(.windows), .skipInGitHubActions("failing in the GitHub actions runner environment"))
20+
@Suite(.skipHostOS(.windows))
2121
fileprivate struct BuildCommandTests {
2222
private let commandSequenceCodec: any CommandSequenceEncodable = LLVMStyleCommandCodec()
2323

Tests/SwiftBuildTests/ConsoleCommands/CreateXCFrameworkCommandTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import SWBTestSupport
1717

1818
// Note: The functionality of this class is heavily unit tested in `XCFrameworkTests.swift`. These tests are only to ensure that the command is indeed hooked up and registered properly.
1919

20-
@Suite(.skipInGitHubActions("failing in the GitHub actions runner environment"), .skipHostOS(.windows))
20+
@Suite(.skipHostOS(.windows))
2121
fileprivate struct CreateXCFrameworkCommandTests {
2222
@Test
2323
func commandInvocation() async throws {

Tests/SwiftBuildTests/ConsoleCommands/GeneralCommandsTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import SwiftBuild
1515
import SWBTestSupport
1616
import SWBUtil
1717

18-
@Suite(.skipInGitHubActions("failing in the GitHub actions runner environment"), .skipHostOS(.windows))
18+
@Suite(.skipHostOS(.windows))
1919
fileprivate struct GeneralCommandsTests {
2020
@Test(.skipHostOS(.windows), // PTY not supported on Windows
2121
.requireHostOS(.macOS)) // something with terminal echo is different on macOS vs Linux

Tests/SwiftBuildTests/ConsoleCommands/ServiceConsoleTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import System
2525
import SystemPackage
2626
#endif
2727

28-
@Suite(.skipHostOS(.windows))
28+
@Suite
2929
fileprivate struct ServiceConsoleTests {
3030
@Test
3131
func emptyInput() async throws {

Tests/SwiftBuildTests/ConsoleCommands/SessionCommandsTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import SWBTestSupport
1414
import Testing
1515
import SWBUtil
1616

17-
@Suite(.skipInGitHubActions("failing in the GitHub actions runner environment"), .skipHostOS(.windows))
17+
@Suite(.skipHostOS(.windows))
1818
fileprivate struct SessionCommandsTests {
1919
@Test(.skipHostOS(.windows), // PTY not supported on Windows
2020
.requireHostOS(.macOS)) // something with terminal echo is different on macOS vs Linux

Tests/SwiftBuildTests/ConsoleCommands/XcodeCommandsTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import SWBTestSupport
1414
import Testing
1515
import SWBUtil
1616

17-
@Suite(.skipInGitHubActions("failing in the GitHub actions runner environment"), .skipHostOS(.windows))
17+
@Suite(.skipHostOS(.windows))
1818
fileprivate struct XcodeCommandsTests {
1919
@Test(.skipHostOS(.windows), // PTY not supported on Windows
2020
.requireHostOS(.macOS)) // something with terminal echo is different on macOS vs Linux

0 commit comments

Comments
 (0)