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

Failed to export xccovreport from xcresult #33

Open
intoxicated opened this issue May 29, 2020 · 14 comments
Open

Failed to export xccovreport from xcresult #33

intoxicated opened this issue May 29, 2020 · 14 comments
Assignees

Comments

@intoxicated
Copy link

[11:17:06]: Derived content from ["/Users/wooyoung.chung/Development/xxx/build/Logs/Test//Test-Transient Testing-2020.05.29_11-13-05--0700.xcresult", "/Users/wooyoung.chung/Development/messaging-ios/build/Logs/Test//LogStoreManifest.plist"]
[11:17:06]: Error occured while exporting xccovreport from xcresult '/Users/wooyoung.chung/Development/xxx/build/Logs/Test/Test-Transient Testing-2020.05.29_11-13-05--0700.xcresult'
[11:17:06]: Make sure you have both Xcode 11 selected and pointing to the correct xcresult file

but there is a xcresult file in the path. Any idea?

@intoxicated
Copy link
Author

weird thing is sometime it works and sometimes it doesn't

@intoxicated
Copy link
Author

it seems like if output path exists, it fails

@timfuqua
Copy link

timfuqua commented Oct 6, 2020

it seems like if output path exists, it fails

I'm experiencing this behavior as well. I can get around this in my CI, but I feel like this is a bug.

@joshdholtz
Copy link
Member

👋 Hello! Would either of you be able to provide any more detail on this?

To be honest... I don’t use xcov in personal projects so also not with danger but I’m happy to look into! Would be good to have any info that you may have that would help 🤷‍♂️

@timfuqua
Copy link

timfuqua commented Oct 6, 2020

I'm actually not using Danger, just vanilla xcov (1.7.5). I just found this thread through googling the exact string "Error occured while exporting xccovreport from xcresult", and there were only like 2 hits.

I can't provide a solid example project, since I'm encountering this with one of my employer's projects, but I doubt it would be hard to reproduce. Here's my directory structure:

.
├── [typical fastlane files]
├── README.md
├── report.xml
└── test_output
    ├── code-coverage
    │   ├── index.html
    │   ├── resources
    │   │   ├── application.css
    │   │   ├── application.js
    │   │   ├── bootstrap.min.css
    │   │   ├── bootstrap.min.js
    │   │   ├── file_cpp.png
    │   │   ├── file_objc.png
    │   │   ├── file_swift.png
    │   │   ├── jquery.min.js
    │   │   ├── main.css
    │   │   ├── main.js
    │   │   ├── opensans.css
    │   │   └── xcov_logo.png
    │   ├── xccovarchive-0.xccovarchive
    │   │   ├── Coverage
    │   │   ├── Index
    │   │   └── Metadata.plist
    │   └── xccovreport-0.xccovreport
    ├── report.html
    └── report.junit

All I'm doing to get around this is running a rm -rf ../fastlane/test_output/code-coverage before the next call to xcov.

Maybe the -0 on the .xccovarchive and .xccovreport is messing things up?

@joshdholtz
Copy link
Member

I really appreciate the info! I’ll try and find some time in my queue for this 😊

@ferrerod
Copy link

ferrerod commented Jan 21, 2021

removing the xcov code coverage output before the next run allows it to succeed consistently

@GG-beyond
Copy link

removing the xcov code coverage output before the next run allows it to succeed consistently

Correct, I would like to solve this bug@joshdholtz

@pradyhk
Copy link

pradyhk commented Feb 11, 2021

worked for me when i used project parameter instead of workspace..

@kumareshsaran
Copy link

The below issue happened to me also

Error occured while exporting xccovreport from xcresult '/Users/wooyoung.chung/Development/xxx/build/Logs/Test/Test-Transient Testing-2020.05.29_11-13-05--0700.xcresult'
Make sure you have both Xcode 11 selected and pointing to the correct xcresult file

This issue happened because the root project folder contains old test report file.
delete the old report file before the unit test stage.

rm -rf ./fastlane/<<output_folder>>

unit_test:
  allow_failure: true
  stage: unit_test
  script:
   - rm -rf fastlane/xcov_report
   - bundle exec fastlane tests
  tags:

@clivejefferies
Copy link

I have a weird experience with this. It was working with removing the file, like advised. Then I had problems and updated Ruby and Fastlane. I can see it getting removed and then added back after scan, but I still get the error.

@stherold
Copy link

I started to get the error too today :-/

@ivanglushko
Copy link

This fails when the output folder exists the workaround is to delete a folder each time you run the command:

lane :coverage do
	top_dir = `git rev-parse --show-toplevel`.strip
	output_dir = "#{top_dir}/fastlane/output/coverage"
	# workaround if the output folder exists xcov fails
	if Dir.exist?(output_dir)
		FileUtils.remove_dir(output_dir)
	end
	xcov(
	  workspace: "Example/Example.xcworkspace",
	  scheme: "Example",
	  output_directory: output_dir,
	  markdown_report: true
	)
end

@Blackjacx
Copy link

In our case it was due to the usage of an outdated dependency. After the dependency has been released using the newest Xcode version, the issue has been gone 👍

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