Skip to content

Commit 28ce835

Browse files
committed
Enable Windows CI
FileOperationsTestWindows.testPermissions fails on Windows in a container environment with Hyper-V isolated containers; see https://learn.microsoft.com/en-us/virtualization/windowscontainers/manage-containers/persistent-storage#permissions for some potentially-relevant information. Skip it if we detect we're in a container. Closes #223
1 parent 1b8167d commit 28ce835

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

.github/workflows/pull_request.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ jobs:
1010
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main
1111
with:
1212
linux_exclude_swift_versions: '[{"swift_version": "5.8"}]'
13-
# https://github.com/apple/swift-system/issues/223
14-
enable_windows_checks: false
1513
soundness:
1614
name: Soundness
1715
uses: swiftlang/github-workflows/.github/workflows/soundness.yml@main

Tests/SystemTests/FileOperationsTestWindows.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,9 @@ final class FileOperationsTestWindows: XCTestCase {
174174

175175
/// Test that the umask works properly
176176
func testUmask() throws {
177+
// See https://learn.microsoft.com/en-us/virtualization/windowscontainers/manage-containers/persistent-storage#permissions
178+
try XCTSkipIf(NSUserName() == "ContainerAdministrator", "containers use a different permission model")
179+
177180
// Default mask should be 0o022
178181
XCTAssertEqual(FilePermissions.creationMask, [.groupWrite, .otherWrite])
179182

@@ -205,6 +208,9 @@ final class FileOperationsTestWindows: XCTestCase {
205208

206209
/// Test that setting permissions on a file works as expected
207210
func testPermissions() throws {
211+
// See https://learn.microsoft.com/en-us/virtualization/windowscontainers/manage-containers/persistent-storage#permissions
212+
try XCTSkipIf(NSUserName() == "ContainerAdministrator", "containers use a different permission model")
213+
208214
try FilePermissions.withCreationMask([]) {
209215
try withTemporaryFilePath(basename: "testPermissions") { path in
210216
let tests = [

0 commit comments

Comments
 (0)