1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-30 03:37:36 +00:00

CI: Add x86_64 Clang Coverage pipeline in Azure

Add a job to the Azure pipelines to run tests with coverage enabled, and
aggregate the test results in a folder of html pages showing the
coverage results overall, and per-file.

Future work is needed to take the published pipeline artifact for the
coverage results and display them somewhere interesting.
This commit is contained in:
Andrew Kaster 2022-03-19 16:42:54 -06:00 committed by Andreas Kling
parent 3e32fb911e
commit 44bcd7c7aa
3 changed files with 50 additions and 3 deletions

View file

@ -1,8 +1,9 @@
parameters:
arch: 'i686'
coverage: 'OFF'
jobs:
- job: 'Serenity_Clang_${{ parameters.arch }}'
- job: 'Serenity_Clang_${{ parameters.arch }}_Coverage_${{ parameters.coverage }}'
timeoutInMinutes: 0 # Setting to 0 means the maximum allowed timeout is used.
variables:
@ -24,6 +25,7 @@ jobs:
- template: Caches.yml
parameters:
arch: '${{ parameters.arch }}'
coverage: '${{ parameters.coverage }}'
toolchain: 'clang'
build_directory: 'Build/${{ parameters.arch }}clang'
toolchain_ccache_path: '$(LLVM_CCACHE_DIR)'
@ -44,6 +46,7 @@ jobs:
-DSERENITY_ARCH=${{ parameters.arch }} \
-DSERENITY_TOOLCHAIN=Clang \
-DENABLE_UNDEFINED_SANITIZER=ON \
-DENABLE_USERSPACE_COVERAGE_COLLECTION=${{ parameters.coverage }} \
-DENABLE_PCI_IDS_DOWNLOAD=OFF \
-DENABLE_USB_IDS_DOWNLOAD=OFF \
-DCMAKE_C_COMPILER=gcc-11 \
@ -81,6 +84,7 @@ jobs:
echo "##[error]:^( Tests failed, failing job"
exit 1
fi
sudo umount fsmount
displayName: 'Test'
workingDirectory: $(Build.SourcesDirectory)/Build/${{ parameters.arch }}clang
timeoutInMinutes: 60
@ -95,6 +99,27 @@ jobs:
workingDirectory: $(Build.SourcesDirectory)/Build/${{ parameters.arch }}clang
condition: failed()
- ${{ if eq(parameters.coverage, 'ON') }}:
- script: |
./Meta/analyze-qemu-coverage.sh
displayName: 'Aggregate Coverage Results'
workingDirectory: $(Build.SourcesDirectory)
env:
SERENITY_TOOLCHAIN: Clang
SERENITY_ARCH: ${{ parameters.arch }}
# FIXME: Deploy the static html pages somewhere
# FIXME: Alter script to also (instead?) produce a raw coverage.txt file for ingestion into sonar cloud
# Note: tmp_profile_data/Coverage.profdata has the entire combined profile data, but creating the raw txt requires
# all of the instrumented binaries and the profdata file.
- ${{ if eq(parameters.coverage, 'ON') }}:
- task: PublishPipelineArtifact@1
inputs:
targetPath: $(Build.SourcesDirectory)/Build/${{ parameters.arch }}clang/reports
artifactType: 'pipeline'
artifactName: 'Coverage'
- script: |
echo "##[section]Toolchain Cache"
CCACHE_DIR='$(LLVM_CCACHE_DIR)' ccache -s