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

Missing clean: true to delete the existing code coverage data #198

Open
prashanth-sams opened this issue Feb 18, 2022 · 3 comments
Open

Comments

@prashanth-sams
Copy link

It is not allowing to export new coverage unless the existing data is empty

@uknowmeright
Copy link

I am also experiencing this.
I need to go in and remove the xcov_output folder each time for it to successfully output the coverage data.
Is anyone else experiencing this?

@JuLima14
Copy link

same, for now I'm removing the output_directory

@TiagoSAmaral
Copy link

TiagoSAmaral commented Jun 16, 2023

If you use fastlane, you can do this:

  desc "Clear XCov output folder"
  lane :clear_xcov_report do
      sh "cd .. && if [ -d 'code-coverage-report' ]; then rm -Rf code-coverage-report; fi"
  end

  desc "Create coverage report"
  lane :coverage do 
    clear_derived_data
    clear_xcov_report
    run_tests(scheme: "unit-tests", devices: ["iPhone 14 Pro (16.4)"])
    # https://docs.fastlane.tools/actions/xcov/
    xcov(
          project: "XXX-XXX.xcodeproj",
          scheme: "unit-tests",
          output_directory: "code-coverage-report",
          ignore_file_path: "./.xcovignore"
        )
  end

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

4 participants