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

No filenames when using the GitHub Actions renderer with Swift Testing #328

Open
clausjoergensen opened this issue Oct 28, 2024 · 1 comment

Comments

@clausjoergensen
Copy link

clausjoergensen commented Oct 28, 2024

When running with --renderer github-actions the Swift Testing output doesn't contain a filename.

Compare this sample where I have both a regular XCTest and a Swift Test

[DemoApp] Processing Info.plist
[DemoAppTests] Processing empty-DemoAppTests.plist
Signing DemoAppTests.xctest (in target 'DemoAppTests' from project 'DemoApp')
Signing DemoApp.debug.dylib (in target 'DemoApp' from project 'DemoApp')
Signing __preview.dylib (in target 'DemoApp' from project 'DemoApp')
Signing DemoApp.app (in target 'DemoApp' from project 'DemoApp')
All tests
DemoAppTests.xctest
UnitTest
::error file=/Users/clajun/Source/other/xcode-demo-app-for-gha/DemoAppTests/UnitTest.swift,line=5::    testExample, XCTAssertTrue failed
Executed 1 test, with 1 failure (0 unexpected) in 0.135 (0.135) seconds
Test Suite 'DemoAppTests.xctest' failed at 2024-10-28 15:13:22.401.
Executed 1 test, with 1 failure (0 unexpected) in 0.135 (0.135) seconds
Test Suite 'All tests' failed at 2024-10-28 15:13:22.401.
Executed 1 test, with 1 failure (0 unexpected) in 0.135 (0.136) seconds
Test run started.
Suite DemoAppTests started
::notice ::Recorded an issue (DemoAppTests.swift:7:9: Expectation failed: true == false)
::error ::"true should not be false" (0.004 seconds) 1 issue(s)
::error ::Suite DemoAppTests failed after 0.005 seconds with 1 issue(s)
::error ::Test run with 1 tests failed after 0.005 seconds with 1 issue(s)
2024-10-28 15:13:30.639 xcodebuild[62861:55001310] [MT] IDETestOperationsObserverDebug: 21.403 elapsed -- Testing started completed.
2024-10-28 15:13:30.639 xcodebuild[62861:55001310] [MT] IDETestOperationsObserverDebug: 0.000 sec, +0.000 sec -- start
2024-10-28 15:13:30.639 xcodebuild[62861:55001310] [MT] IDETestOperationsObserverDebug: 21.403 sec, +21.403 sec -- end
Failing tests:
	UnitTest.testExample()
	DemoAppTests.isTrue()

** TEST FAILED **

The GitHub Actions annotations for the Swift Test:

::notice ::Recorded an issue (DemoAppTests.swift:7:9: Expectation failed: true == false)
::error ::"true should not be false" (0.004 seconds) 1 issue(s)

vs. the XCTest:

::error file=/Users/clajun/Source/other/xcode-demo-app-for-gha/DemoAppTests/UnitTest.swift,line=5::    testExample, 
@clausjoergensen
Copy link
Author

clausjoergensen commented Oct 28, 2024

Based on the output, it should be possible to capture it:

◇ Test run started.
↳ Testing Library Version: 94 (arm64-apple-ios13.0-simulator)
◇ Suite DemoAppTests started.
◇ Test "true should not be false" started.
✘ Test "true should not be false" recorded an issue at DemoAppTests.swift:7:9: Expectation failed: true == false
✘ Test "true should not be false" failed after 0.001 seconds with 1 issue.
✘ Suite DemoAppTests failed after 0.002 seconds with 1 issue.
✘ Test run with 1 test failed after 0.002 seconds with 1 issue.

But maybe the lack of a full path is a problem?

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

No branches or pull requests

1 participant