Giter Site home page Giter Site logo

Comments (2)

chrisballinger avatar chrisballinger commented on May 5, 2024

As of Xcode 11 you need to preprocess the xcresult first: https://github.com/ChargePoint/xcparse#code-coverage

from danger-xcov.

Kaspik avatar Kaspik commented on May 5, 2024

So finally working solution for this would be something like this (I'm using Github Actions with Danger and build.sh script file called from the yaml file).

build.sh:

  bundle install
  pod install --repo-update
  set -o pipefail && bundle exec fastlane tests
  echo "Running Danger..."
  xcparse codecov ./fastlane/test_output/app.xcresult ./fastlane/test_coverage
  bundle exec fastlane danger_tests
  rm -fr ./fastlane/test_coverage
  rm -rf ./fastlane/build_folder

Fastfile:

  1. tests:
  desc "Runs app tests - UNIT + UI tests"
  lane :tests do\
    # First build the project to the build_folder directory
    run_tests(
      workspace: WORKSPACE_NAME,
      scheme: TARGET_NAME,
      derived_data_path: "./fastlane/build_folder",
      build_for_testing: true,
      device: "iPhone 11 Pro",
      code_coverage: true
    )
    # Then run tests without building the project itself
    run_tests(
      workspace: WORKSPACE_NAME,
      scheme: TARGET_NAME,
      derived_data_path: "./fastlane/build_folder",
      test_without_building: true,
      device: "iPhone 11 Pro",
      result_bundle: true,
      output_types: "html",
      prelaunch_simulator: true,
      code_coverage: true
    )
  end
  1. danger_tests:
desc "Run Danger check for tests coverage"
  lane :danger_tests do |options|
    danger(
        danger_id: "Tests",
        dangerfile: "DangerfileBuild",
        github_api_token: ENV["GITHUB_API_TOKEN"]
    )
  end
  1. DangerfileBuild:
xcov.report(
   scheme: 'TARGET_NAME',
   workspace: 'WORKSPACE_NAME',
   output_directory: 'xcov_output',
   only_project_targets: true
)

As you can see, the problem here is that I have to run xcparse codecov ./fastlane/test_output/app.xcresult ./fastlane/test_coverage ro get the right file from build folder as xcov works on build folder, but danger-xcov is not updated for that.

Would be nice to update this project.
@joshdholtz

from danger-xcov.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.