Sebastian Schmidt 22ccb752e7 Split up Auth and AppCheck logic 4 سال پیش
..
generate_code_coverage_report 1a25a10f8d Update type of binary size request (#8585) 4 سال پیش
Gemfile 0b081a3054 Create Binary Size Report Generation (#8539) 4 سال پیش
README.md 0b081a3054 Create Binary Size Report Generation (#8539) 4 سال پیش
code_coverage_file_list.json 22ccb752e7 Split up Auth and AppCheck logic 4 سال پیش
create_binary_size_report.sh 77dae88bb9 Update binary size tool to connect to the Metrics Service in postsubmits. (#8550) 4 سال پیش
get_updated_files.sh e2802b50b5 Post binary size reports in presubmits. (#8587) 4 سال پیش
git_diff_to_json.sh 0b081a3054 Create Binary Size Report Generation (#8539) 4 سال پیش
pod_test_code_coverage_report.sh 0b081a3054 Create Binary Size Report Generation (#8539) 4 سال پیش
post_incremental_coverage_in_pr.rb 0b081a3054 Create Binary Size Report Generation (#8539) 4 سال پیش

README.md

Code Coverage 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.

Add a new coverage workflow

To create a code coverage workflow for a new SDK,

  1. Add newsdk and its patterns in code_coverage_file_list.json.
  2. Add a new output flag, e.g. 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.
  3. 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.

  4. 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.