Skip to content

Add better unit test failure diagnostics for when basic SwiftPM commands fail #3334

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

Merged
merged 1 commit into from
Mar 9, 2021

Conversation

abertelrud
Copy link
Contributor

Add the stdout that was received to the test failure, so we can know what the problem is. This is good in general, since it's hard to diagnose these failures without seeing the output.

The motivation here is to find and fix a unit test failure that only seems to happen in CI.

…nds fail

The motivation here is to find and fix a unit test failure that only seems to happen in CI.
@abertelrud abertelrud self-assigned this Mar 8, 2021
@@ -34,15 +34,18 @@ final class PackageToolTests: XCTestCase {
}

func testUsage() throws {
XCTAssert(try execute(["--help"]).stdout.contains("USAGE: swift package"))
let stdout = try execute(["-help"]).stdout
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The use of a single dash here is intentional so that we test both --help and -help. The build tool test already did this, the others did not.

@abertelrud
Copy link
Contributor Author

@swift-ci please smoke test

@tomerd tomerd added the ready Author believes the PR is ready to be merged & any feedback has been addressed label Mar 8, 2021
@abertelrud abertelrud merged commit e372f7a into swiftlang:main Mar 9, 2021
@abertelrud abertelrud deleted the assertion-dignostics branch March 9, 2021 00:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready Author believes the PR is ready to be merged & any feedback has been addressed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants