-
Notifications
You must be signed in to change notification settings - Fork 128
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
Remove unneeded print statements #101
Conversation
@swift-ci please test |
@swift-ci Please test Linux platform |
@swift-ci Please test macOS platform |
I am confused. What has happened with the last two commits? Did you realize that change wasn't needed? |
That’s correct. Purging |
You need to rebase this to get the latest stuff from main. While you are doing this, it would be good to remove the the purging commit and the revert of that one so the history is a bit cleaner. |
Apart from that looks fine. |
e280a8a
to
513ef3b
Compare
@swift-ci please test |
@talzag Does this resolve the issue of Swift-DocC tests failing in Swift CI during toolchain builds, and if so, why? Also, why did the test start failing in Swift CI; was it due to a change in another component in Swift? |
@franklinsch I’m actually not sure if this is the issue that caused Swift-DocC tests to fail in the toolchain pipelines. In the radar @d-ronnqvist pointed out that none of the tests are marked as failing. However, I was seeing this test fail every time I ran the tests from the command line. I don’t think this was caused by a change in a Swift component because I can reproduce the failure with the 5.6 snapshot toolchain and with the toolchain in my installed Xcode. |
513ef3b
to
1a830f9
Compare
@swift-ci please test |
16f5d1a
to
fe6ca0a
Compare
@swift-ci please test |
fe6ca0a
to
f53b18b
Compare
Hey @talzag, I'm wondering if this PR title could be improved to be more specific to the code changes it contains. The title says "ensure the stdout is empty" but I'm not sure how the code changes do that. Maybe rename to something like "Remove unneeded prints" or so? This is minutia but would be helpful when reviewing git history |
Encountering this bug too when I recently tested swift-docc in terminal with |
Hey @icanzilb that’s a good point. I’ll update the title to be clearer about what this PR is changing. |
@Kyle-Ye good catch! When tests are run in parallel, a process is spawned for each test class:
Each test class has it’s own |
f53b18b
to
3a65d18
Compare
@swift-ci please test |
rdar://87784021
rdar://87784021
3a65d18
to
7cee2a5
Compare
@swift-ci please test |
Bug/issue #, if applicable: rdar://87784021
Summary
The test
LogHandleTests.testFlushesStandardOutput()
fails when run outside of Xcode becausestdout
is written to by other tests and types. This was breaking the assumption thatstdout
would be empty when it was written to by the test. This PR removes several print statements from the tests that have no effect on the tests, and changes theCoverageAction
type to write to a provided log handle rather than print directly tostdout
.Dependencies
None.
Testing
Steps:
cd </path/to/swift-docc>
xcrun --toolchain org.swift.<toolchain ID> swift test
(i.e.xcrun --toolchain org.swift.56202203021a swift test
)/usr/libexec/PlistBuddy -c "Print CFBundleIdentifier:" /Library/Developer/Toolchains/<toolchain>/Info.plist
--experimental-documentation-coverage
flag (i.e.swift run docc convert --experimental-documentation-coverage --level=brief /path/to/docs.docc
)Checklist
AddedUpdated tests./bin/test
script and it succeededUpdated documentation if necessary