Skip to content
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

TraitsTests fails when running in 6.1 toolchain #8131

Open
1 task done
bkhouri opened this issue Nov 21, 2024 · 1 comment
Open
1 task done

TraitsTests fails when running in 6.1 toolchain #8131

bkhouri opened this issue Nov 21, 2024 · 1 comment
Labels

Comments

@bkhouri
Copy link
Contributor

bkhouri commented Nov 21, 2024

Is it reproducible with SwiftPM command-line tools: swift build, swift test, swift package etc?

  • Confirmed reproduction steps with SwiftPM CLI. The description text must include reproduction steps with either of command-line SwiftPM commands, swift build, swift test, swift package etc.

Description

Some of the TraitsTests are failing when running against 6.1 toolchain. This is preventing the self-hosted macOS pipeline to upgrade from 5.9 top 6.1 toolchain

Expected behavior

All tests in TraitTests should pass. More specifically, the XCTAssertFalse(stderr.contains("warning:")) in each test should not be wrapped in a XCTAssertThrowsError() and should not be commented out. This part of the test may have been updated to allow the test to pass with the 6.x toolchain.

                XCTAssertFalse(stderr.contains("warning:"))

Actual behavior

❯ git rev-parse HEAD                                 
cb829d83d016beb6607fde42136a079c37297d90

❯ swift build --build-tests
<...SNI...>
[48/48] Linking SwiftPMPackageTests
Build complete! (18.86s)

❯ swift test --filter "TraitTest*"
[1/1] Planning build
Building for debugging...
[2/2] Write swift-version--2A2C2CE82E0D52A1.txt
Build complete! (4.51s)
Test Suite 'Selected tests' started at 2024-11-21 09:01:08.654.
Test Suite 'SwiftPMPackageTests.xctest' started at 2024-11-21 09:01:08.656.
Test Suite 'TraitTests' started at 2024-11-21 09:01:08.656.
Test Case '-[FunctionalTests.TraitTests testTests_whenAllTraitsEnabled_andDefaultTraitsDisabled]' started.
Test Case '-[FunctionalTests.TraitTests testTests_whenAllTraitsEnabled_andDefaultTraitsDisabled]' passed (72.768 seconds).
Test Case '-[FunctionalTests.TraitTests testTests_whenNoFlagPassed]' started.
Test Case '-[FunctionalTests.TraitTests testTests_whenNoFlagPassed]' passed (12.702 seconds).
Test Case '-[FunctionalTests.TraitTests testTraits_dumpPackage]' started.
Test Case '-[FunctionalTests.TraitTests testTraits_dumpPackage]' passed (4.528 seconds).
Test Case '-[FunctionalTests.TraitTests testTraits_whenAllTraitsEnabled_andDefaultTraitsDisabled]' started.
/Users/bkhouri/Documents/git/public/swiftlang/swift-package-manager/Tests/FunctionalTests/TraitTests.swift:161: error: -[FunctionalTests.TraitTests testTraits_whenAllTraitsEnabled_andDefaultTraitsDisabled] : XCTAssertFalse failed
Test Case '-[FunctionalTests.TraitTests testTraits_whenAllTraitsEnabled_andDefaultTraitsDisabled]' failed (11.622 seconds).
Test Case '-[FunctionalTests.TraitTests testTraits_whenAllTraitsEnabled]' started.
/Users/bkhouri/Documents/git/public/swiftlang/swift-package-manager/Tests/FunctionalTests/TraitTests.swift:136: error: -[FunctionalTests.TraitTests testTraits_whenAllTraitsEnabled] : XCTAssertFalse failed
Test Case '-[FunctionalTests.TraitTests testTraits_whenAllTraitsEnabled]' failed (11.261 seconds).
Test Case '-[FunctionalTests.TraitTests testTraits_whenDefaultTraitsDisabled]' started.
/Users/bkhouri/Documents/git/public/swiftlang/swift-package-manager/Tests/FunctionalTests/TraitTests.swift:105: error: -[FunctionalTests.TraitTests testTraits_whenDefaultTraitsDisabled] : XCTAssertFalse failed
Test Case '-[FunctionalTests.TraitTests testTraits_whenDefaultTraitsDisabled]' failed (9.884 seconds).
Test Case '-[FunctionalTests.TraitTests testTraits_whenIndividualTraitsEnabled_andDefaultTraitsDisabled]' started.
/Users/bkhouri/Documents/git/public/swiftlang/swift-package-manager/Tests/FunctionalTests/TraitTests.swift:119: error: -[FunctionalTests.TraitTests testTraits_whenIndividualTraitsEnabled_andDefaultTraitsDisabled] : XCTAssertFalse failed
Test Case '-[FunctionalTests.TraitTests testTraits_whenIndividualTraitsEnabled_andDefaultTraitsDisabled]' failed (10.647 seconds).
Test Case '-[FunctionalTests.TraitTests testTraits_whenIndividualTraitsEnabled_andDefaultTraits]' started.
/Users/bkhouri/Documents/git/public/swiftlang/swift-package-manager/Tests/FunctionalTests/TraitTests.swift:84: error: -[FunctionalTests.TraitTests testTraits_whenIndividualTraitsEnabled_andDefaultTraits] : XCTAssertFalse failed
Test Case '-[FunctionalTests.TraitTests testTraits_whenIndividualTraitsEnabled_andDefaultTraits]' failed (10.932 seconds).
Test Case '-[FunctionalTests.TraitTests testTraits_whenNoFlagPassed]' started.
/Users/bkhouri/Documents/git/public/swiftlang/swift-package-manager/Tests/FunctionalTests/TraitTests.swift:24: error: -[FunctionalTests.TraitTests testTraits_whenNoFlagPassed] : XCTAssertFalse failed
Test Case '-[FunctionalTests.TraitTests testTraits_whenNoFlagPassed]' failed (10.593 seconds).
Test Case '-[FunctionalTests.TraitTests testTraits_whenTraitUnification_whenSecondTraitNotEnabled]' started.
/Users/bkhouri/Documents/git/public/swiftlang/swift-package-manager/Tests/FunctionalTests/TraitTests.swift:64: error: -[FunctionalTests.TraitTests testTraits_whenTraitUnification_whenSecondTraitNotEnabled] : XCTAssertFalse failed
Test Case '-[FunctionalTests.TraitTests testTraits_whenTraitUnification_whenSecondTraitNotEnabled]' failed (10.968 seconds).
Test Case '-[FunctionalTests.TraitTests testTraits_whenTraitUnification]' started.
/Users/bkhouri/Documents/git/public/swiftlang/swift-package-manager/Tests/FunctionalTests/TraitTests.swift:42: error: -[FunctionalTests.TraitTests testTraits_whenTraitUnification] : XCTAssertFalse failed
Test Case '-[FunctionalTests.TraitTests testTraits_whenTraitUnification]' failed (10.950 seconds).
Test Suite 'TraitTests' failed at 2024-11-21 09:04:05.511.
         Executed 11 tests, with 8 failures (0 unexpected) in 176.855 (176.855) seconds
Test Suite 'SwiftPMPackageTests.xctest' failed at 2024-11-21 09:04:05.511.
         Executed 11 tests, with 8 failures (0 unexpected) in 176.855 (176.855) seconds
Test Suite 'Selected tests' failed at 2024-11-21 09:04:05.511.
         Executed 11 tests, with 8 failures (0 unexpected) in 176.855 (176.857) seconds
◇ Test run started.
↳ Testing Library Version: 107
↳ Target Platform: arm64e-apple-macos14.0
✔ Test run with 0 tests passed after 0.001 seconds.

Steps to reproduce

Ensure theXCTAssertFalse(stderr.contains("warning:")) in the tests are not wrapped in a XCTAssertThrowsError() call, then

git checkout cb829d83d016beb6607fde42136a079c37297d90
swift test --filter "TraitTests"

Swift Package Manager version/commit hash

cb829d8

Swift & OS version (output of swift --version ; uname -a)

❯ swiftly list
Installed release toolchains
----------------------------
<... SNIP ...>
Installed snapshot toolchains
-----------------------------
main-snapshot-2024-11-16 (in use)


❯ swift --version
warning: Unable to locate libSwiftScan. Fallback to `swift-frontend` dependency scanner invocation.
Apple Swift version 6.1-dev (LLVM c7635515f932833, Swift dbf388c0a58df0e)
Target: arm64-apple-macosx15.0

❯ uname -a
Darwin BKs-Work-M1Pro-MacBook-Pro-2.local 24.2.0 Darwin Kernel Version 24.2.0: Fri Oct 25 20:33:26 PDT 2024; root:xnu_development-11215.60.400.0.1~11/DEVELOPMENT_ARM64_T6000 arm64
@bkhouri bkhouri added the bug label Nov 21, 2024
dschaefer2 pushed a commit that referenced this issue Nov 21, 2024
Disable assertion in `TraitTests`, which was never executed on macOS due
to the self-hosted macOS pipeline running Swift 5.9..2, and test being
wrapped around `#if compiler(>=6.0)` pre-processor.

### Motivation:

The assertion in `TraitTets` that ensured warnigs do not appear in
stderr are failing against the 6.1 toolchain. Since 1) this test was
never executed against macOS, since the self-hosted macOS pipeline was
running Swift 5.9.2, and 2) work is underway to productive the Traits
feature, it was decided to disable the assert for now, and open a GitHub
issue to re-enable the assert with the production work.

This change removes the assert for GitHub issue 8131, which must be
re-enabled when the respective issue is fixed.

### Modifications:

Disabled assertion the the `TraitTests`

### Result:

```
swift test --filter "TraitTests"
```


### NOTE:
It is expected the assertions will be re-introduced when #8131 is fixed.
bkhouri added a commit to bkhouri/swift-package-manager that referenced this issue Nov 25, 2024
Disable assertion in `TraitTests`, which was never executed on macOS due
to the self-hosted macOS pipeline running Swift 5.9..2, and test being
wrapped around `#if compiler(>=6.0)` pre-processor.

### Motivation:

The assertion in `TraitTets` that ensured warnigs do not appear in
stderr are failing against the 6.1 toolchain. Since 1) this test was
never executed against macOS, since the self-hosted macOS pipeline was
running Swift 5.9.2, and 2) work is underway to productive the Traits
feature, it was decided to disable the assert for now, and open a GitHub
issue to re-enable the assert with the production work.

This change removes the assert for GitHub issue 8131, which must be
re-enabled when the respective issue is fixed.

### Modifications:

Disabled assertion the the `TraitTests`

### Result:

```
swift test --filter "TraitTests"
```

### NOTE:
It is expected the assertions will be re-introduced when swiftlang#8131 is fixed.

(cherry picked from commit dca0cc2)
@MaxDesiatov
Copy link
Contributor

cc @FranzBusch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants