Plug in code coverage collection into tests and upload to ADO (#208)

This commit is contained in:
Timothee Guerin 2022-01-28 09:44:56 -08:00 коммит произвёл GitHub
Родитель a18d6258d4
Коммит 47a7851d9e
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
16 изменённых файлов: 891 добавлений и 14 удалений

Просмотреть файл

@ -9,6 +9,9 @@ common/scripts/
common/changes/
common/config/rush/pnpm-lock.yaml
# Coverage report directory
**/coverage/
# These are standard and should not be edited
SECURITY.md
CODE_OF_CONDUCT.md

Просмотреть файл

@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@cadl-lang/compiler",
"comment": "",
"type": "none"
}
],
"packageName": "@cadl-lang/compiler"
}

Просмотреть файл

@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@cadl-lang/openapi3",
"comment": "",
"type": "none"
}
],
"packageName": "@cadl-lang/openapi3"
}

Просмотреть файл

@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@cadl-lang/rest",
"comment": "",
"type": "none"
}
],
"packageName": "@cadl-lang/rest"
}

Просмотреть файл

@ -29,6 +29,13 @@
"summary": "(CUSTOM) Runs all tests for CI or PR validation. Disallows .only.",
"shellCommand": "node eng/scripts/npm-run.js test-official"
},
{
"commandKind": "global",
"safeForSimultaneousRushProcesses": true,
"name": "merge-coverage",
"summary": "(CUSTOM) Merge the coverage reports generated by running `rush test-official`",
"shellCommand": "npx istanbul report --include **/coverage/**/coverage-final.json cobertura text"
},
{
"commandKind": "global",
"name": "format",

820
common/config/rush/pnpm-lock.yaml сгенерированный

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -24,6 +24,15 @@ steps:
- script: node common/scripts/install-run-rush.js test-official
displayName: Test
- script: node common/scripts/install-run-rush.js merge-coverage
displayName: Merge code coverage
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: "Cobertura"
summaryFileLocation: $(Build.SourcesDirectory)/coverage/cobertura-coverage.xml
displayName: Publish code coverage
- script: node common/scripts/install-run-rush.js check-format
displayName: Check Formatting

Просмотреть файл

@ -0,0 +1,3 @@
{
"reporter": ["cobertura", "json", "text"]
}

Просмотреть файл

@ -0,0 +1,4 @@
timeout: 5000
require: source-map-support/register
spec: "dist/test/**/*.js"
ignore: "dist/test/manual/**/*.js"

Просмотреть файл

@ -37,8 +37,8 @@
"compile": "tsc -p .",
"watch": "tsc -p . --watch",
"dogfood": "node scripts/dogfood.js",
"test": "mocha --timeout 5000 --require source-map-support/register --ignore 'dist/test/manual/**/*.js' 'dist/test/**/*.js'",
"test-official": "mocha --forbid-only --timeout 5000 --require source-map-support/register --ignore 'dist/test/manual/**/*.js' 'dist/test/**/*.js'",
"test": "mocha",
"test-official": "c8 mocha --forbid-only",
"regen-nonascii": "node scripts/regen-nonascii.js",
"fuzz": "node dist/test/manual/fuzz.js run"
},
@ -68,6 +68,7 @@
"@types/yargs": "~17.0.2",
"grammarkdown": "~3.1.2",
"mocha": "~8.3.2",
"c8": "~7.11.0",
"prettier-plugin-organize-imports": "~1.1.1",
"source-map-support": "~0.5.19",
"typescript": "~4.4.4"

Просмотреть файл

@ -0,0 +1,3 @@
{
"reporter": ["cobertura", "json", "text"]
}

Просмотреть файл

@ -0,0 +1,4 @@
timeout: 5000
require: source-map-support/register
spec: "dist/test/**/*.js"
ignore: "dist/test/manual/**/*.js"

Просмотреть файл

@ -25,8 +25,8 @@
"scripts": {
"build": "tsc -p .",
"watch": "tsc -p . --watch",
"test": "mocha --timeout 5000 --require source-map-support/register --ignore 'dist/test/manual/**/*.js' 'dist/test/**/*.js'",
"test-official": "mocha --forbid-only --timeout 5000 --require source-map-support/register --ignore 'dist/test/manual/**/*.js' 'dist/test/**/*.js'"
"test": "mocha",
"test-official": "c8 mocha --forbid-only"
},
"files": [
"lib/*.cadl",
@ -43,6 +43,7 @@
"@cadl-lang/compiler": "~0.25.0",
"@cadl-lang/rest": "~0.8.0",
"mocha": "~8.3.2",
"c8": "~7.11.0",
"typescript": "~4.4.4"
}
}

3
packages/rest/.c8rc.json Normal file
Просмотреть файл

@ -0,0 +1,3 @@
{
"reporter": ["cobertura", "json", "text"]
}

Просмотреть файл

@ -0,0 +1,4 @@
timeout: 5000
require: source-map-support/register
spec: "dist/test/**/*.js"
ignore: "dist/test/manual/**/*.js"

Просмотреть файл

@ -25,8 +25,8 @@
"scripts": {
"build": "tsc -p .",
"watch": "tsc -p . --watch",
"test": "mocha --timeout 5000 --require source-map-support/register --ignore 'dist/test/manual/**/*.js' 'dist/test/**/*.js'",
"test-official": "mocha --forbid-only --timeout 5000 --require source-map-support/register --ignore 'dist/test/manual/**/*.js' 'dist/test/**/*.js'"
"test": "mocha",
"test-official": "c8 mocha --forbid-only"
},
"files": [
"lib/*.cadl",
@ -41,6 +41,7 @@
"@types/node": "~14.0.27",
"@cadl-lang/compiler": "~0.25.0",
"mocha": "~8.3.2",
"c8": "~7.11.0",
"typescript": "~4.4.4"
}
}