|
|
il y a 4 ans | |
|---|---|---|
| .. | ||
| generate_code_coverage_report | 121f56e9ac Update the type to Cocoapods (#8846) | il y a 4 ans |
| Gemfile | 0b081a3054 Create Binary Size Report Generation (#8539) | il y a 4 ans |
| README.md | 8256dde2a0 Add doc for binary size measurement. (#8930) | il y a 4 ans |
| code_coverage_file_list.json | b3c83ef294 Add sdk size measurement (#8879) | il y a 4 ans |
| create_binary_size_report.sh | b3c83ef294 Add sdk size measurement (#8879) | il y a 4 ans |
| get_updated_files.sh | e2802b50b5 Post binary size reports in presubmits. (#8587) | il y a 4 ans |
| git_diff_to_json.sh | 0b081a3054 Create Binary Size Report Generation (#8539) | il y a 4 ans |
| pod_test_code_coverage_report.sh | 0b081a3054 Create Binary Size Report Generation (#8539) | il y a 4 ans |
| post_incremental_coverage_in_pr.rb | 0b081a3054 Create Binary Size Report Generation (#8539) | il y a 4 ans |
This directory includes code coverage report generation and binary size report generation.
This tool is to help generate coverage reports for pull requests. It's defined by the test_coverage workflow.
Coverage reports of SDK frameworks will be displayed in a pull request if the change is under corresponding SDK file patterns.
UpdatedFilesCollector will detect file changes and compare file paths to file patterns in code_coverage_file_list.json. If updated file paths fit any patterns, corresponding SDK coverage job will be triggered.
To create a code coverage workflow for a new SDK,
newsdk and its patterns in code_coverage_file_list.json.newsdk_run_job, in the coverage workflow. newsdk_run_job should be aligned with the name of SDK newsdk in code_coverage_file_list.json.Add a newsdk coverage job in the workflow:
pod-lib-lint-newsdk:
needs: check
# Don't run on private repo unless it is a PR.
if: always() && github.repository == 'Firebase/firebase-ios-sdk' && (needs.check.outputs.newsdk_run_job == 'true'|| github.event.pull_request.merged)
runs-on: macOS-latest
strategy:
matrix:
target: [iOS]
steps:
- uses: actions/checkout@v2
- name: Setup Bundler
run: scripts/setup_bundler.sh
- name: Build and test
run: ./scripts/health_metrics/pod_test_code_coverage_report.sh FirebaseNewSDK "${{ matrix.target }}"
- uses: actions/upload-artifact@v2
with:
name: codecoverage
path: /Users/runner/*.xcresult
Add the job name to the needs of create_report job.
If this newsdk podspec has unit test setup, e.g. database, with unit_tests.scheme = { :code_coverage => true }, the code coverage workflow should run unit tests through podspecs and utilize those coverage data and nothing is needed to update here. Otherwise, add another way of running tests and generating xcresult bundles with code coverage data in pod_test_code_coverage_report.sh.
This tool is to generate a report for SDK binary sizes. create_binary_size_report.sh will trigger BinarySizeReportGenerator which will run cocoapods-size to create a binary size report and either post it in PRs in presubmits or upload it to the Metrics Service.
To replicate an SDK binary size measurement locally, we can run the following script to get the binary size of the latest released FirebaseABTesting SDK.
git clone https://github.com/google/cocoapods-size
cd cocoapods-size
python3 measure_cocoapod_size.py --cocoapods FirebaseABTesting
More about CocoaPods Size measurement could be found here
The binary_size_metrics on GitHub Actions workflow
is running binary size measurement presubmits and postsubmits. The environment for this job
could be found in runs-on. More details about the envionment could be found here.
Factors below might also affect the binary size:
arm64 and the destination is generic/platform=iOS Simulator when a testapp is built.