From 6367ceeaf1c04284a98069704a3ecd3ed6b8e3b6 Mon Sep 17 00:00:00 2001 From: Brett Logan Date: Wed, 20 Nov 2019 23:22:08 -0500 Subject: [PATCH] [BE-709] Add code coverage report to AZP Signed-off-by: Brett Logan --- app/test/package.json | 1 + ci/azure-pipelines.yml | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/app/test/package.json b/app/test/package.json index f894d5f57..a8e4f4544 100644 --- a/app/test/package.json +++ b/app/test/package.json @@ -27,6 +27,7 @@ "extension": [ ".js" ], + "reporter": "cobertura", "lines": 80, "functions": 80, "statements": 80, diff --git a/ci/azure-pipelines.yml b/ci/azure-pipelines.yml index 367136b17..7d590e393 100644 --- a/ci/azure-pipelines.yml +++ b/ci/azure-pipelines.yml @@ -20,6 +20,19 @@ jobs: echo "--------> npm tests with code coverage" npm run test:ci -- -u --coverage && npm run build displayName: Run Tests With Coverage Report + - script: | + cd client + wget https://raw.github.com/eriwen/lcov-to-cobertura-xml/master/lcov_cobertura/lcov_cobertura.py + python lcov_cobertura.py ./coverage/lcov.info + mv $(System.DefaultWorkingDirectory)/app/test/*.js $(System.DefaultWorkingDirectory)/client + displayName: Create Cobertura Report + - script: npx cobertura-merge -o output.xml package1=$(System.DefaultWorkingDirectory)/app/test/coverage/cobertura-coverage.xml package2=$(System.DefaultWorkingDirectory)/client/coverage.xml + displayName: Merge Cobertura Reports + - task: PublishCodeCoverageResults@1 + inputs: + codeCoverageTool: 'Cobertura' + summaryFileLocation: $(System.DefaultWorkingDirectory)/output.xml + pathToSources: $(System.DefaultWorkingDirectory)/client - job: SanityChecks pool: