Feature Request: stop using xcpretty junit for scan retry #292
Comments
Thank you for the request. I do not have a lot of time to work on this plugin, so I would have to prioritize it lower than the more critical issues. If you'd like to try your hand at making the changes, I am open to PRs and I can provide guidance (also checkout the CONTRIBUTING guidelines). I already have the action tests_from_xcresult in this plugin, so you could use that to get the test results rather than the You would change Or, maybe you're lucky and some other generous soul will pick this up. |
Thank you for instructions! I will think about it. |
@lyndsey-ferguson, I tried to use
What's the best to do? Allign the format or reformat |
Otherwise, |
@lyndsey-ferguson, thanks for quick reply! Sorry, my bad, It was vice versa:
|
So, you probably want to put a t.delete('()') |
And wind a way to replace TestCase to TargetName in the same class? |
Can you elaborate? It isn't clear to me what the question is. |
@lyndsey-ferguson, sorry for that. I have a question about same name difference:
Shall I make |
Ouch, what!? My action returns testcases for the first segment! How embarrassing!!! Yes, it should return TargetNames as the first segment. |
We decided to use the following actions instead:
Reason - we want to switch from scan to xcodebuild action to run the tests because of this issue: fastlane/fastlane#17563 |
Interesting. I could probably monkeypatch scan so it doesn't do that. |
Sometimes our macOS tests hang when using Xcode12+. When this happens then ruby is at 100% CPU usage and either the app or the test runner or both are stuck in some kind of logging (-[XCTestLog testLogWithFormat:] in the test, _NSLogv in the regular app from the spindumps I have saved) The feedbackassistant people suggested trying to remove |
As far as I know |
@Cyberbeni can you elaborate on what you're going to try doing? |
I'm trying to get to a point where tests never hang (which is time consuming because they don't always hang, so I have to run them a lot) just taking out |
The test runs with disabled xcpretty (thus with regular scan, without retries) didn't hang so far (could be a coincident but based on the history, it's 90+% that it's not) so supporting disable_xcpretty would help us too. (These hangs don't affect iOS tests, only macOS ones, and only with Xcode 12+) |
You tested with iOS tests? Similar number of tests? |
Both iOS and macOS run at least once every day on all supported platforms. iOS has around 180 tests and runs 6 simulators parallelly with 18 batches. macOS has around 200 tests, which is randomly split into 2 that run on separate machines. |
I don't know if a ruby spindump is any useful to you, apart from seeing that it spends all of its time in |
One of the tests completed in 5 hours and 45 minutes (compared to the normal 90 minutes), so I'm trying to pipe the log file through xcpretty and it is taking a long time on my local machine too. We print out the view hierarchy in the failure description and replace newlines with edit: I took out this description formatting to a single line as the whole description can be accessed when running the tests manually through screen share, so xcpretty won't be that big of a hit for us anymore. |
The Ruby Spindump isn't helpful. I have used rbspy to help me when I was parallelizing the iOS builds; I don't know if that will help you. If xcpretty is the cause of this slowdown, the result is to use xcresult files instead to find out which tests failed. Unfortunately, I won't be free to spend any significant time on this until at least December. |
We removed the code that produced the output that made xcpretty take long in some cases, it took 32 minutes to format a log with 5 failures and half second when replacing the long lines . (The raw log of the last retry is saved, so if we really need to know what was the state at the moment of failure, we can use that instead) |
Note for anyone watching: I'm prioritizing this feature now and am working on the plan. As far as the |
@Cyberbeni @yakimant I have started working on this feature to use xcresult files to find the failing tests instead of the junit files. If you're interested in alpha testing, can you modify your Pluginfile:
If there are problems, please let me know and attach the console output as a text file to this issue (makes it easier for me to review). If it works, please let me know. |
I'm currently on vacation, will try it out next week. |
|
@Cyberbeni sorry about that, I've fixed that issue. |
There is a problem with older Xcodes (10.1 and older). After running the first batch, there is a crash because there is no xcresult file at
Attached stack trace: For iOS we also use Xcode 12.5, that seems to work. As far as I can tell, the |
@Cyberbeni yes, the action that is supposed to get tests from an xcresult only works for Xcode 11+. I'll have to put some more work into |
@Cyberbeni so, you're saying that there is no |
I want to apologize that I have not responded to this issue. A family health issue is requiring me to narrow my focus on the essentials and I don't have the time I need to focus on the plugin more than a minute. If you can get some other contributors to this project to help with this, I would consider merging a resulting PR. |
Please switch to other junit generation tool
Motivation Behind Feature
xcprerry is not updated for several years, looks like it's loosing support:
xcpretty/xcpretty#360
It generates junit from xcodebuild log, which can cause issues.
Sometimes it misses some failed tests, which is dangerous for CI.
Where are other tools, which rely on xcresults for junit generation and more reliable (fastlane-community/trainer, TitouanVanBelle/XCTestHTMLReport).
Feature Description
I see 2 options:
Alternatives or Workarounds
We are going to switch off xcpretty junit generation and setup XCTestHTMLReport.
When we are going to use suppress_tests_from_junit and trey scan.
The text was updated successfully, but these errors were encountered: