apple / swift-argument-parser

Straightforward, type-safe argument parsing for Swift
Apache License 2.0
3.31k stars 311 forks source link

[DNM] checking macOS CI #575

Closed MaxDesiatov closed 1 year ago

MaxDesiatov commented 1 year ago

Replace this paragraph with a description of your changes and rationale. Provide links to an existing issue or external references/discussions, if appropriate.

Checklist

MaxDesiatov commented 1 year ago

@swift-ci test

rauhul commented 1 year ago

@natecook1000 @shahmishal I'm not sure what to make of this failure

The code under test is guarded by:

    mutating func run() async throws {
        guard #available(macOS 12.0, iOS 15.0, tvOS 15.0, watchOS 8.0, *) else {
          print("'count-lines' isn't supported on this platform.")
          return
        }

and the tests are similarly guarded:

  func testCountLines() throws {
    guard #available(macOS 12, *) else { return }

Somehow the test guard is passed but the run guard is not passed causing a test failure. This only seems plausible if the test platform is not macOS but supposedly the test platform is macOS. Any ideas what's going on?

rauhul commented 1 year ago

@swift-ci please test macOS

natecook1000 commented 1 year ago

Very odd… From the test output before the tests are run, the CI appears to be running on macOS 12.6:

+ sw_vers
ProductName:    macOS
ProductVersion: 12.6
BuildVersion:   21G115
[Pipeline] sh
+ swift --version
Apple Swift version 5.9-dev (LLVM d4f2e6a78286ad2, Swift cbd0b15fb9ecffb)
Target: x86_64-apple-macosx12.0

But the output indicates that it's running under macOS 10.16 (the last bit is ProcessInfo.processInfo.operatingSystemVersionString):

error: -[ArgumentParserExampleTests.CountLinesExampleTests testCountLines] : failed - Strings are not equal.
+ 20
- 'count-lines' isn't supported on this platform:
  20
- Version 10.16 (Build 21G115)
natecook1000 commented 1 year ago

@swift-ci Please test macOS platform

natecook1000 commented 1 year ago

Resolved this in #576