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

"Error occured while exporting xccovreport from xcresult" when using Xcode 11.7 #187

Open
denysowova opened this issue Oct 7, 2020 · 10 comments
Assignees

Comments

@denysowova
Copy link

denysowova commented Oct 7, 2020

Hello. I'm using xcov locally to test it with our project and plan to use it later in our Bitrise pipeline. It works well with Xcode 12, but when switching the command line tools to Xcode 11.7, the following error is thrown:

Error occured while exporting xccovreport from xcresult '/DerivedData/TestApp-cecebhsfvzltmlebjlxheijkwewa/Logs/Test/Run-TestApp-2020.10.07_17-51-01-+0300.xcresult'
Make sure you have both Xcode 11 selected and pointing to the correct xcresult file

Any possible fix on that? Thanks in advance.

@joshdholtz
Copy link
Member

This looks like a similar issue to fastlane-community/danger-xcov#33

I’ll add this to my queue to look into! Probably won’t be able to get to it myself this week 😔

@joshdholtz joshdholtz self-assigned this Oct 7, 2020
@denysowova
Copy link
Author

Thank you, @joshdholtz

@XiaoxiaYao
Copy link

It's weird. I am using Xcode 12.2. Facing the same issue. Will wait for the fix. Thank you @joshdholtz in advance.

@weibel
Copy link

weibel commented Dec 22, 2020

xcov 1.7.5, Xcode 12.2, Command example:

xcov --html_report false --only_project_targets -s BandLibrary --derived_data_path ./DerivedData -o ./ -f bandlibrary.xcresult

Xcov would then complain with

/Users/jenkins/.rvm/gems/ruby-2.6.5@unit_test/gems/xcov-1.7.5/lib/xcov/manager.rb:225:in `rename': Directory not empty @ rb_file_s_rename - (./action_0.xccovarchive, ./xccovarchive-0.xccovarchive) (Errno::ENOTEMPTY)

In manager.rb I replaced lines 225 and 226 with

FileUtils.mv(tmp_archive_paths[i], "#{output_path}/xccovarchive-#{index + i}.xccovarchive", force: true)
FileUtils.mv(item, "#{output_path}/xccovreport-#{index + i}.xccovreport", force: true)

Then it would process. However prior to this I had already copied a number of .xcovreports and .xcovarchives into the directory for later processing which xcov now seemed to pick up with

Merging multiple coverage reports with <here follows all previosly stored .xcovereports and .xcovarchives>

and a list of this type with each of my previously stored reports and archives

Copying .xccovreport to ./apiconnectorslibrary.xccovreport

I don't know enough about xcov to be able to say if the steps with merging and copying is the intended operation. Should I copy the xcresult to an empty directory for processing?

@asam139
Copy link

asam139 commented Mar 3, 2021

Same problem using 12.4. It is interesting because if I clean the output directory it works very well, but after the first xccoarchive files/directories are created the next time some directories with the name "action" appears and it fails.

Thanks so much for the help, I love this tool!!! 💯

Traceback (most recent call last):
39: from /Users/93sauu/.rvm/gems/ruby-2.6.3/bin/ruby_executable_hooks:24:in <main>' 38: from /Users/93sauu/.rvm/gems/ruby-2.6.3/bin/ruby_executable_hooks:24:in eval'
37: from /Users/93sauu/.rvm/gems/ruby-2.6.3/bin/fastlane:23:in <main>' 36: from /Users/93sauu/.rvm/gems/ruby-2.6.3/bin/fastlane:23:in load'
35: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/fastlane-2.176.0/bin/fastlane:23:in <top (required)>' 34: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/fastlane-2.176.0/fastlane/lib/fastlane/cli_tools_distributor.rb:122:in take_off'
33: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/fastlane-2.176.0/fastlane/lib/fastlane/commands_generator.rb:41:in start' 32: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/fastlane-2.176.0/fastlane/lib/fastlane/commands_generator.rb:352:in run'
31: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/commander-fastlane-4.4.6/lib/commander/delegates.rb:15:in run!' 30: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/fastlane-2.176.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:76:in run!'
29: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/commander-fastlane-4.4.6/lib/commander/runner.rb:476:in run_active_command' 28: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/commander-fastlane-4.4.6/lib/commander/command.rb:153:in run'
27: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/commander-fastlane-4.4.6/lib/commander/command.rb:178:in call' 26: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/fastlane-2.176.0/fastlane/lib/fastlane/commands_generator.rb:108:in block (2 levels) in run'
25: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/fastlane-2.176.0/fastlane/lib/fastlane/command_line_handler.rb:36:in handle' 24: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/fastlane-2.176.0/fastlane/lib/fastlane/lane_manager.rb:47:in cruise_lane'
23: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/fastlane-2.176.0/fastlane/lib/fastlane/runner.rb:45:in execute' 22: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/fastlane-2.176.0/fastlane/lib/fastlane/runner.rb:45:in chdir'
21: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/fastlane-2.176.0/fastlane/lib/fastlane/runner.rb:49:in block in execute' 20: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/fastlane-2.176.0/fastlane/lib/fastlane/lane.rb:33:in call'
19: from Fastfile:118:in block (2 levels) in parsing_binding' 18: from Fastfile:138:in check_xcov'
17: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/fastlane-2.176.0/fastlane/lib/fastlane/fast_file.rb:159:in method_missing' 16: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/fastlane-2.176.0/fastlane/lib/fastlane/runner.rb:157:in trigger_action_by_name'
15: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/fastlane-2.176.0/fastlane/lib/fastlane/runner.rb:229:in execute_action' 14: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/fastlane-2.176.0/fastlane/lib/fastlane/runner.rb:229:in chdir'
13: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/fastlane-2.176.0/fastlane/lib/fastlane/runner.rb:255:in block in execute_action' 12: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/fastlane-2.176.0/fastlane/lib/fastlane/actions/actions_helper.rb:69:in execute_action'
11: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/fastlane-2.176.0/fastlane/lib/fastlane/runner.rb:263:in block (2 levels) in execute_action' 10: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/fastlane-2.176.0/fastlane/lib/fastlane/actions/xcov.rb:8:in run'
9: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/xcov-1.7.5/lib/xcov/manager.rb:32:in run' 8: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/xcov-1.7.5/lib/xcov/manager.rb:84:in parse_xccoverage'
7: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/xcov-1.7.5/lib/xcov/manager.rb:215:in process_xcresults!' 6: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/xcov-1.7.5/lib/xcov/manager.rb:215:in flat_map'
5: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/xcov-1.7.5/lib/xcov/manager.rb:215:in each' 4: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/xcov-1.7.5/lib/xcov/manager.rb:224:in block in process_xcresults!'
3: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/xcov-1.7.5/lib/xcov/manager.rb:224:in each_with_index' 2: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/xcov-1.7.5/lib/xcov/manager.rb:224:in each'
1: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/xcov-1.7.5/lib/xcov/manager.rb:225:in block (2 levels) in process_xcresults!' /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/xcov-1.7.5/lib/xcov/manager.rb:225:in rename': Directory not empty @ rb_file_s_rename - (fastlane/xcov_output/action_0.xccovarchive, fastlane/xcov_output/xccovarchive-0.xccovarchive) (Errno::ENOTEMPTY)
38: from /Users/93sauu/.rvm/gems/ruby-2.6.3/bin/ruby_executable_hooks:24:in <main>' 37: from /Users/93sauu/.rvm/gems/ruby-2.6.3/bin/ruby_executable_hooks:24:in eval'
36: from /Users/93sauu/.rvm/gems/ruby-2.6.3/bin/fastlane:23:in <main>' 35: from /Users/93sauu/.rvm/gems/ruby-2.6.3/bin/fastlane:23:in load'
34: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/fastlane-2.176.0/bin/fastlane:23:in <top (required)>' 33: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/fastlane-2.176.0/fastlane/lib/fastlane/cli_tools_distributor.rb:122:in take_off'
32: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/fastlane-2.176.0/fastlane/lib/fastlane/commands_generator.rb:41:in start' 31: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/fastlane-2.176.0/fastlane/lib/fastlane/commands_generator.rb:352:in run'
30: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/commander-fastlane-4.4.6/lib/commander/delegates.rb:15:in run!' 29: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/fastlane-2.176.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:76:in run!'
28: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/commander-fastlane-4.4.6/lib/commander/runner.rb:476:in run_active_command' 27: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/commander-fastlane-4.4.6/lib/commander/command.rb:153:in run'
26: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/commander-fastlane-4.4.6/lib/commander/command.rb:178:in call' 25: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/fastlane-2.176.0/fastlane/lib/fastlane/commands_generator.rb:108:in block (2 levels) in run'
24: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/fastlane-2.176.0/fastlane/lib/fastlane/command_line_handler.rb:36:in handle' 23: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/fastlane-2.176.0/fastlane/lib/fastlane/lane_manager.rb:47:in cruise_lane'
22: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/fastlane-2.176.0/fastlane/lib/fastlane/runner.rb:45:in execute' 21: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/fastlane-2.176.0/fastlane/lib/fastlane/runner.rb:45:in chdir'
20: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/fastlane-2.176.0/fastlane/lib/fastlane/runner.rb:49:in block in execute' 19: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/fastlane-2.176.0/fastlane/lib/fastlane/lane.rb:33:in call'
18: from Fastfile:118:in block (2 levels) in parsing_binding' 17: from Fastfile:138:in check_xcov'
16: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/fastlane-2.176.0/fastlane/lib/fastlane/fast_file.rb:159:in method_missing' 15: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/fastlane-2.176.0/fastlane/lib/fastlane/runner.rb:157:in trigger_action_by_name'
14: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/fastlane-2.176.0/fastlane/lib/fastlane/runner.rb:229:in execute_action' 13: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/fastlane-2.176.0/fastlane/lib/fastlane/runner.rb:229:in chdir'
12: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/fastlane-2.176.0/fastlane/lib/fastlane/runner.rb:255:in block in execute_action' 11: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/fastlane-2.176.0/fastlane/lib/fastlane/actions/actions_helper.rb:69:in execute_action'
10: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/fastlane-2.176.0/fastlane/lib/fastlane/runner.rb:263:in block (2 levels) in execute_action' 9: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/fastlane-2.176.0/fastlane/lib/fastlane/actions/xcov.rb:8:in run'
8: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/xcov-1.7.5/lib/xcov/manager.rb:32:in run' 7: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/xcov-1.7.5/lib/xcov/manager.rb:84:in parse_xccoverage'
6: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/xcov-1.7.5/lib/xcov/manager.rb:215:in process_xcresults!' 5: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/xcov-1.7.5/lib/xcov/manager.rb:215:in flat_map'
4: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/xcov-1.7.5/lib/xcov/manager.rb:215:in each' 3: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/xcov-1.7.5/lib/xcov/manager.rb:216:in block in process_xcresults!'
2: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/xcov-1.7.5/lib/xcov/manager.rb:232:in rescue in block in process_xcresults!' 1: from /Users/93sauu/.rvm/gems/ruby-2.6.3/gems/fastlane-2.176.0/fastlane_core/lib/fastlane_core/ui/ui.rb:17:in method_missing'
/Users/93sauu/.rvm/gems/ruby-2.6.3/gems/fastlane-2.176.0/fastlane_core/lib/fastlane_core/ui/interface.rb:129:in `crash!': [!] Failed to export xccovreport from xcresult' (FastlaneCore::Interface::FastlaneCrash)

@cameronehrlich
Copy link

Anyone have a workaround for this?

@HossamYoussof
Copy link

Clear output directory before check

    clear_derived_data(derived_data_path: COVERAGE_OUTPUT_PATH)

    xcov(
      skip_slack: true,
      scheme: LIVE_SCHEME,
      output_directory: COVERAGE_OUTPUT_PATH,
      derived_data_path: DERIVED_DATA_PATH,
      minimum_coverage_percentage: MINIMUM_COVERAGE_PERCENTAGE
    )

@BeibeiLewis
Copy link

Hello. I'm using xcov locally to test it with our project and plan to use it later in our Bitrise pipeline. It works well with Xcode 12, but when switching the command line tools to Xcode 11.7, the following error is thrown:

Error occured while exporting xccovreport from xcresult '/DerivedData/TestApp-cecebhsfvzltmlebjlxheijkwewa/Logs/Test/Run-TestApp-2020.10.07_17-51-01-+0300.xcresult'
Make sure you have both Xcode 11 selected and pointing to the correct xcresult file

Any possible fix on that? Thanks in advance.

Hello, Have you resolved the issue? i hit the issue too.

@MagFer
Copy link

MagFer commented Jan 31, 2024

Are you using M1/2/3 machines? This could be related to #222

@imranMnts
Copy link

imranMnts commented Apr 4, 2024

any update? it still doesn't work on XCode 15.3 (M1) in my laptop + CICD

[09:13:00]: Error occured while exporting xccovreport from xcresult '/Users/builder/Library/Developer/Xcode/DerivedData/project-gnfsiyddddsqqdlykqcavcvxvfxv/Logs/Test/Run-project-2024.04.04_09-11-32-+0000.xcresult'
[09:13:00]: Make sure you have both Xcode 11 selected and pointing to the correct xcresult file

Does someone know how to fix it?

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

No branches or pull requests

10 participants