Comments (2)
As of Xcode 11 you need to preprocess the xcresult first: https://github.com/ChargePoint/xcparse#code-coverage
from danger-xcov.
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
:
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
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
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)
- Is it need maintain xcov_report folder HOT 4
- Invalid xcodebuild command execution on Xcode Bots CI HOT 4
- Plugin seems to break when used with xcov 1.1 HOT 2
- Unable to find any .xccoverage file (CircleCI) HOT 13
- Unable to find any .xccoverage file
- Scheme name not shown on danger error message HOT 6
- Test coverage shows 0.00%
- Not working anymore with Fastlane 2.86.0 HOT 7
- Improve handling a missing .xccoverage file HOT 3
- Add Support for Xcode 11 xcresult & xccovreport HOT 16
- xcov overall coverage report including ignore files and showing wrong coverage HOT 1
- Incompatible with Fastlane 2.137 HOT 12
- Dangerfile doesn't work HOT 2
- Failed to export xccovreport from xcresult HOT 14
- failed to load command: danger HOT 4
- 'Invalid Dangerfile' after Fastlane 2.172.0 update HOT 3
- `Dangerfile` file: undefined method `map' for false:FalseClass
- danger-xcov plugin keep complaining about the missing xccoverage file. HOT 1
- Integrate with Danger.swift file HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from danger-xcov.