Skip to content

Test: Skip test on Amazon Linux 2 #8649

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import Testing

import struct TSCUtility.Version


struct FilePackageSigningEntityStorageTests {
@Test
func happyCase() async throws {
Expand Down Expand Up @@ -326,7 +327,12 @@ struct FilePackageSigningEntityStorageTests {
#expect(packageSigners.signers[davinci]?.origins == [.registry(URL("http://foo.com"))])
}

@Test
@Test(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you refactor this into its own trait so it's reusable?

extension Trait where Self == Testing.ConditionTrait {
    package static var skipAmazonLinux2: Self {
        disabled("Test fails on Amazon Linux 2", {
            ProcessInfo.hostOperatingSystem == .linux && (FileManager.default.contents(atPath: "/etc/system-release").map({ String(decoding: $0, as: UTF8.self) == "Amazon Linux release 2 (Karoo)\n" }) ?? false)
        })
    }
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I definitely thought of this, but that's not currently possible as adding an import Testing in the _InternalTestSupport target will cause other pipelines to start failing since, in the build-script, swift PM will build itself using Cmake, and then will build the projects using the artifacts that was produced with the Cmake.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be possible once swiftlang/swift#81401 is merged, hopefully.

.disabled(
if: ProcessInfo.hostOperatingSystem == .linux && (FileManager.default.contents(atPath: "/etc/system-release").map({ String(decoding: $0, as: UTF8.self) == "Amazon Linux release 2 (Karoo)\n" }) ?? false),
"Test fails on Amazon Linux 2",
)
)
func changeSigningEntityFromVersion_unrecognizedSigningEntityShouldError() async throws {
let mockFileSystem = InMemoryFileSystem()
let directoryPath = AbsolutePath("/signing")
Expand Down