Skip to content

Commit

Permalink
Fix Android CI Pipeline code coverage failure (#21504)
Browse files Browse the repository at this point in the history
### Description
<!-- Describe your changes. -->
Current failure is due to a version mismatch.

Use llvm-cov from the Android NDK instead of the system gcov so that the
version is correct.

Also comment out publishing to the Azure dashboard to simplify the
setup. The CI prints out the stats for review by developers.

### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->
Fix CI pipeline
  • Loading branch information
skottmckay authored Jul 25, 2024
1 parent c235178 commit 3cdf4b9
Showing 1 changed file with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,10 @@ stages:

- template: templates/clean-agent-build-directory-step.yml

- stage: MASTER_BUILD_STAGE
# The below jobs only run on master build.
- stage: MAIN_BUILD_STAGE
# The below jobs only run on build of main branch.
# because coverage report is hard to support in cross machines.
displayName: NNAPI MASTER BUILD&TEST
displayName: NNAPI MAIN BUILD&TEST
dependsOn: []
condition: in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI')
jobs:
Expand Down Expand Up @@ -225,29 +225,29 @@ stages:
--code_coverage
displayName: NNAPI EP, Build, Test, CodeCoverage on Android Emulator
# We need to use llvm-cov from the NDK.
- script: |
python3 -m pip install gcovr && \
python3 tools/ci_build/coverage.py \
--build_dir build_nnapi \
--android_sdk_path $ANDROID_HOME
export GCOV="$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-cov gcov"
python3 -m pip install gcovr
python3 tools/ci_build/coverage.py --build_dir build_nnapi --android_sdk_path $ANDROID_HOME
displayName: Retrieve runtime code coverage files from the emulator and analyze
- script: cat '$(Build.SourcesDirectory)/build_nnapi/Debug/coverage_rpt.txt'
displayName: Print coverage report

# - task: AzureCLI@2
# displayName: 'Post Android Code Coverage To DashBoard'
# inputs:
# azureSubscription: AIInfraBuild
# scriptType: bash
# scriptPath: $(Build.SourcesDirectory)/tools/ci_build/github/linux/upload_code_coverage_data.sh
# arguments: '"$(Build.SourcesDirectory)/build_nnapi/Debug/coverage_rpt.txt" "https://dev.azure.com/onnxruntime/onnxruntime/_build/results?buildId=$(Build.BuildId)" arm android nnapi'
# workingDirectory: '$(Build.BinariesDirectory)'

- script: /bin/bash tools/ci_build/github/linux/ort_minimal/nnapi_minimal_build_minimal_ort_and_run_tests.sh $(pwd)
# Build Minimal ORT with NNAPI and reduced Ops, run unit tests on Android Emulator
displayName: Build Minimal ORT with NNAPI and run tests

- task: AzureCLI@2
displayName: 'Post Android Code Coverage To DashBoard'
inputs:
azureSubscription: AIInfraBuild
scriptType: bash
scriptPath: $(Build.SourcesDirectory)/tools/ci_build/github/linux/upload_code_coverage_data.sh
arguments: '"$(Build.SourcesDirectory)/build_nnapi/Debug/coverage_rpt.txt" "https://dev.azure.com/onnxruntime/onnxruntime/_build/results?buildId=$(Build.BuildId)" arm android nnapi'
workingDirectory: '$(Build.BinariesDirectory)'

- template: templates/use-android-emulator.yml
parameters:
stop: true
Expand Down

0 comments on commit 3cdf4b9

Please sign in to comment.