Publish cobertura code coverage to codecov.io (#850)

* Introduce jest

* Install jest

* Add jest.config.js

* Rename to jest.config.json

* Fix dir workspace

* Fix dir workspace

* Install coveralls earlier

* Add run mocha lcov reporter

* Disable jest --coverage

* Remove path "node_modules/.bin/" from jscover command

* Try rush report-coverage

* Ren script report-coverage to reportcoverage

* Try "coverage", look for .coverage files

* Fix Copy .coverage files

* Fix rush coverage

* Add rush report -v

* Add rush reportcoverage

* Separate rush coverage and rush report

* Add set COVERALLS_REPO_TOKEN

* Show env vars

* Use var TokenForCoveralls to set env var

* Send coverage to ../../coverage/commandcoverage.lcov

* Add Create coverage folder

* Mocha redirect without reporter spec

* Return to reportcoverage

* Publish coverage artifacts

* Fix copy files

* Try 2 reporters

* Add .nycrc files

* Restore report scripts

* Add dependency nock

* Dependencies tweaks

* Dummy change.

* Set up codecov reporting

* Fix codecov url

* Fix codecov target url again

* Add task to Populate Code Coverage tab

* Add coverage url build tag

* Clean up .yml

* Clean up .yml 2

* clean up scripts

* Cleanup 3

* Cleanup 4

* Set script "coverage": "nyc npm run test"

* Add html reporter back

* Remove nock from package.json files

* Revert "Remove nock from package.json files"

This reverts commit 3db34f060d.
This commit is contained in:
BruceHaley 2020-06-29 15:35:05 -07:00 коммит произвёл GitHub
Родитель fdf269eeb6
Коммит 86f0302d4b
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
24 изменённых файлов: 150 добавлений и 80 удалений

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

@ -12,18 +12,6 @@ pr:
branches:
include:
- master
paths:
include:
- '*'
exclude:
- README.md
- specs/*
- PortingMap.md
- ToolLifetimeSchedule.md
- AzureCli.md
- CONTRIBUTING.md
- LICENSE
- PRIVACY.md
jobs:
- job: CLI
@ -37,7 +25,6 @@ jobs:
inputs:
tags: 'Version=$(_version)'
continueOnError: true
condition: and(succeeded(), eq(variables['System.PullRequest.IsFork'], 'False'))
- task: NodeTool@0
displayName: 'Use Node 12.x'
@ -45,7 +32,7 @@ jobs:
versionSpec: 12.x
- task: Npm@1
displayName: 'Install rush'
displayName: 'npm install --global @microsoft/rush'
inputs:
command: custom
verbose: false
@ -55,10 +42,41 @@ jobs:
displayName: 'rush update'
- script: 'rush build -p 2'
displayName: 'rush build'
displayName: 'rush build -p 2'
- script: 'rush test -p 2 -v'
displayName: 'rush test'
- script: 'rush coverage -v'
displayName: 'rush coverage -v'
- bash: 'bash <(curl -s https://codecov.io/bash)'
displayName: 'push coverage report to codecov.io - https://codecov.io/github/microsoft/botframework-cli/commit/$(Build.SourceVersion)'
env:
CODECOV_TOKEN: $(TokenForCodecov)
- task: colinsalmcorner.colinsalmcorner-buildtasks.tag-build-task.tagBuildOrRelease@0
displayName: 'Tag Build with coverage url'
inputs:
tags: 'https://codecov.io/gh/microsoft/botframework-cli/tree/$(Build.SourceVersion)/packages'
continueOnError: true
- task: PublishCodeCoverageResults@1
displayName: 'Populate Code Coverage tab'
inputs:
codeCoverageTool: 'cobertura' # Options: cobertura, jaCoCo
summaryFileLocation: $(System.DefaultWorkingDirectory)/packages/*/coverage/cobertura-coverage.xml
continueOnError: true
- task: CopyFiles@2
displayName: 'Copy coverage files to: $(Build.StagingDirectory)/coverage'
inputs:
SourceFolder: '$(Build.SourcesDirectory)/packages'
Contents: '*/coverage/**'
TargetFolder: '$(Build.StagingDirectory)/coverage'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: coverage'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)/coverage'
ArtifactName: coverage
- script: 'rush posttest'
displayName: 'rush posttest'
@ -67,21 +85,23 @@ jobs:
displayName: 'Version and Pack'
- task: CopyFiles@2
displayName: 'Copy Files to: $(Build.ArtifactStagingDirectory)'
displayName: 'Copy packages to: $(Build.ArtifactStagingDirectory)/drop'
inputs:
SourceFolder: ./.output
Contents: '**/*.tgz'
TargetFolder: '$(Build.ArtifactStagingDirectory)'
TargetFolder: '$(Build.ArtifactStagingDirectory)/drop'
flattenFolders: true
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: drop'
inputs:
artifactName: 'drop'
PathtoPublish: '$(Build.ArtifactStagingDirectory)/drop'
ArtifactName: drop
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
displayName: 'Component Detection'
- script: 'rush report:coverage'
displayName: 'rush report:coverage'
enabled: false
- powershell: 'Get-ChildItem .. -ErrorAction Continue -Recurse -Force | Where {$_.FullName -notlike "*node_modules*"}'
displayName: 'Dir workspace except node_modules'
continueOnError: true
condition: succeededOrFailed()

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

@ -29,7 +29,7 @@
"commandKind": "global",
"name": "pack",
"summary": "Create .tgz packages for publishing in CI",
"description":"This doesn't currently work because rush doesn't allow the passing of arbitrary commands like version numbers yet. \n Use node ./common/scripts/version-and-pack.js --version X.X.X-tag instead.",
"description": "This doesn't currently work because rush doesn't allow the passing of arbitrary commands like version numbers yet. \n Use node ./common/scripts/version-and-pack.js --version X.X.X-tag instead.",
"shellCommand": "node -e \"throw new Error(`Not supported yet. \\nUse node ./common/scripts/version-and-pack.js --version X.X.X-tag instead`)\""
},
/**

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

@ -13,11 +13,12 @@
"**/*.d.ts"
],
"reporter": [
"text",
"html"
"html",
"lcov",
"text"
],
"all": true,
"cache": true,
"extends": "@istanbuljs/nyc-config-typescript",
"check-coverage": false
}
}

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

@ -5,11 +5,11 @@
"author": "Microsoft",
"bugs": "https://github.com/microsoft/botframework-cli",
"dependencies": {
"@microsoft/bf-cli-command": "1.0.0",
"@oclif/command": "~1.5.19",
"@oclif/config": "~1.13.3",
"botframework-schema": "^4.5.1",
"chalk": "2.4.1",
"@microsoft/bf-cli-command": "1.0.0",
"cli-table3": "^0.5.1",
"fs-extra": "^5.0.0",
"glob": "^7.1.3",
@ -69,13 +69,12 @@
"prepack": "npm run clean && npm run build && npm run doc:readme",
"postpack": "rimraf oclif.manifest.json",
"posttest": "tslint -p test -t stylish",
"build":"tsc -b",
"clean":"rimraf ./.nyc_output ./lib ./package-lock.json ./tsconfig.tsbuildinfo",
"build": "tsc -b",
"clean": "rimraf ./.nyc_output ./lib ./package-lock.json ./tsconfig.tsbuildinfo",
"test": "mocha",
"coverage": "nyc npm run test",
"report:coverage":"npm run coverage && nyc report --reporter=text-lcov | coveralls",
"doc": "npm run build && npm run doc:readme && rimraf oclif.manifest.json",
"doc:readme":"oclif-dev manifest && oclif-dev readme",
"doc:readme": "oclif-dev manifest && oclif-dev readme",
"version": "npm run doc:readme && git add README.md"
}
}

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

@ -13,11 +13,12 @@
"**/*.d.ts"
],
"reporter": [
"text",
"html"
"html",
"lcov",
"text"
],
"all": true,
"cache": true,
"extends": "@istanbuljs/nyc-config-typescript",
"check-coverage": false
}
}

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

@ -49,7 +49,6 @@
"clean": "rimraf ./.nyc_output ./lib ./package-lock.json ./tsconfig.tsbuildinfo",
"test": "mocha",
"coverage": "nyc npm run test",
"report:coverage": "npm run coverage && nyc report --reporter=text-lcov | coveralls",
"doc": "npm run clean && npm run build && npm run doc:readme && rimraf oclif.manifest.json",
"doc:readme": "oclif-dev manifest && oclif-dev readme",
"version": "oclif-dev manifest"
@ -82,10 +81,12 @@
"@types/chai": "^4.1.7",
"@types/fs-extra": "^5.0.5",
"@types/mocha": "^5.2.6",
"@types/nock": "^11.1.0",
"@types/node": "^10.14.6",
"chai": "^4.2.0",
"globby": "^8.0.2",
"mocha": "^6.2.2",
"nock": "^11.7.0",
"nyc": "^14.1.1",
"rimraf": "^2.6.3",
"ts-node": "^8.1.0",

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

@ -13,8 +13,9 @@
"**/*.d.ts"
],
"reporter": [
"text",
"html"
"html",
"lcov",
"text"
],
"all": true,
"cache": true,

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

@ -18,13 +18,12 @@
"prepack": "",
"postpack": "",
"posttest": "",
"build":"tsc -b",
"clean":"rimraf ./.nyc_output ./lib ./package-lock.json ./tsconfig.tsbuildinfo",
"build": "tsc -b",
"clean": "rimraf ./.nyc_output ./lib ./package-lock.json ./tsconfig.tsbuildinfo",
"test": "mocha",
"coverage": "nyc npm run test",
"report:coverage":"npm run coverage && nyc report --reporter=text-lcov | coveralls",
"doc": "",
"doc:readme":"",
"doc:readme": "",
"version": ""
},
"types": "./lib/index.d.ts",
@ -55,6 +54,7 @@
"chai": "^4.2.0",
"fancy-test": "^1.4.3",
"mocha": "^6.2.2",
"nock": "^11.7.0",
"nyc": "^14.1.1",
"proxyquire": "^2.1.0",
"rimraf": "^2.6.3",

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

@ -13,11 +13,12 @@
"**/*.d.ts"
],
"reporter": [
"text",
"html"
"html",
"lcov",
"text"
],
"all": true,
"cache": true,
"extends": "@istanbuljs/nyc-config-typescript",
"check-coverage": false
}
}

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

@ -27,13 +27,12 @@
"scripts": {
"postpack": "rimraf oclif.manifest.json",
"posttest": "tslint -p test -t stylish",
"build":"tsc -b",
"clean":"rimraf ./.nyc_output ./lib ./package-lock.json ./tsconfig.tsbuildinfo",
"build": "tsc -b",
"clean": "rimraf ./.nyc_output ./lib ./package-lock.json ./tsconfig.tsbuildinfo",
"test": "mocha",
"coverage": "nyc npm run test",
"report:coverage":"npm run coverage && nyc report --reporter=text-lcov | coveralls",
"doc": "npm run build && npm run doc:readme && rimraf oclif.manifest.json",
"doc:readme":"oclif-dev manifest && oclif-dev readme",
"doc:readme": "oclif-dev manifest && oclif-dev readme",
"version": "npm run doc:readme && git add README.md"
},
"telemetry": null,

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

@ -13,11 +13,12 @@
"**/*.d.ts"
],
"reporter": [
"text",
"html"
"html",
"lcov",
"text"
],
"all": true,
"cache": true,
"extends": "@istanbuljs/nyc-config-typescript",
"check-coverage": false
}
}

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

@ -32,7 +32,6 @@
"clean": "rimraf ./.nyc_output ./lib ./package-lock.json ./tsconfig.tsbuildinfo",
"test": "mocha",
"coverage": "nyc npm run test",
"report:coverage": "npm run coverage && nyc report --reporter=text-lcov | coveralls",
"doc": "npm run build && npm run doc:readme && rimraf oclif.manifest.json",
"doc:readme": "oclif-dev manifest && oclif-dev readme",
"version": "npm run doc:readme && git add README.md"

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

@ -0,0 +1,24 @@
{
"extension": [
".ts",
".js"
],
"include": [
"src"
],
"exclude": [
"**/node_modules/**",
"**/tests/**",
"**/coverage/**",
"**/*.d.ts"
],
"reporter": [
"html",
"lcov",
"text"
],
"all": true,
"cache": true,
"extends": "@istanbuljs/nyc-config-typescript",
"check-coverage": false
}

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

@ -58,13 +58,12 @@
"prepack": "npm run clean && npm run build && npm run doc:readme",
"postpack": "rimraf oclif.manifest.json",
"posttest": "tslint -p test -t stylish",
"build":"tsc -b",
"clean":"rimraf ./.nyc_output ./lib ./package-lock.json ./tsconfig.tsbuildinfo",
"build": "tsc -b",
"clean": "rimraf ./.nyc_output ./lib ./package-lock.json ./tsconfig.tsbuildinfo",
"test": "mocha",
"coverage": "nyc npm run test",
"report:coverage":"npm run coverage && nyc report --reporter=text-lcov | coveralls",
"doc": "npm run build && npm run doc:readme && rimraf oclif.manifest.json",
"doc:readme":"oclif-dev manifest && oclif-dev readme",
"doc:readme": "oclif-dev manifest && oclif-dev readme",
"version": "npm run doc:readme && git add README.md"
}
}

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

@ -13,11 +13,12 @@
"**/*.d.ts"
],
"reporter": [
"text",
"html"
"html",
"lcov",
"text"
],
"all": true,
"cache": true,
"extends": "@istanbuljs/nyc-config-typescript",
"check-coverage": false
}
}

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

@ -61,7 +61,7 @@
},
"repository": "https://github.com/microsoft/botframework-cli/tree/master/packages/lg",
"scripts": {
"unittest":"rush test -t @microsoft/bf-lg-cli",
"unittest": "rush test -t @microsoft/bf-lg-cli",
"posttest": "eslint . --ext .ts --config .eslintrc",
"prepack": "rm -rf lib && tsc -b && oclif-dev manifest && oclif-dev readme",
"postpack": "rimraf oclif.manifest.json",
@ -69,7 +69,6 @@
"clean": "rimraf ./.nyc_output ./lib ./package-lock.json ./tsconfig.tsbuildinfo",
"test": "mocha",
"coverage": "nyc npm run test",
"report:coverage": "npm run coverage && nyc report --reporter=text-lcov | coveralls",
"doc": "npm run build && npm run doc:readme && rimraf oclif.manifest.json",
"doc:readme": "oclif-dev manifest && oclif-dev readme",
"version": "npm run doc:readme && git add README.md"

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

@ -13,11 +13,12 @@
"**/*.d.ts"
],
"reporter": [
"text",
"html"
"html",
"lcov",
"text"
],
"all": true,
"cache": true,
"extends": "@istanbuljs/nyc-config-typescript",
"check-coverage": false
}
}

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

@ -22,7 +22,6 @@
"clean": "rimraf ./.nyc_output ./lib ./package-lock.json ./tsconfig.tsbuildinfo",
"test": "mocha",
"coverage": "nyc npm run test",
"report:coverage": "npm run coverage && nyc report --reporter=text-lcov | coveralls",
"doc": "",
"doc:readme": "",
"version": "npm run doc:readme && git add README.md"
@ -59,6 +58,7 @@
"@types/chai": "^4.2.0",
"@types/lodash": "~4.14.146",
"@types/mocha": "^5.2.7",
"@types/nock": "^11.1.0",
"@types/node": "^10.14.15",
"chai": "^4.2.0",
"mocha": "^6.2.2",

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

@ -13,11 +13,12 @@
"**/*.d.ts"
],
"reporter": [
"text",
"html"
"html",
"lcov",
"text"
],
"all": true,
"cache": true,
"extends": "@istanbuljs/nyc-config-typescript",
"check-coverage": false
}
}

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

@ -32,7 +32,6 @@
"test": "mocha",
"test:functional": "mocha --config ./test/functional/.mocharc.json **/functional/*.test.{js,ts}",
"coverage": "nyc npm run test",
"report:coverage": "npm run coverage && nyc report --reporter=text-lcov | coveralls",
"doc": "npm run build && npm run doc:readme && rimraf oclif.manifest.json",
"doc:readme": "oclif-dev manifest && oclif-dev readme",
"version": "npm run doc:readme && git add README.md"
@ -63,8 +62,8 @@
"@types/chai": "^4.2.4",
"@types/lodash": "~4.14.146",
"@types/mocha": "^5.2.7",
"@types/node": "^10.17.4",
"@types/nock": "^11.1.0",
"@types/node": "^10.17.4",
"@types/rimraf": "^2.0.3",
"chai": "^4.2.0",
"globby": "^10.0.1",
@ -78,4 +77,4 @@
"typescript": "^3.5.3",
"uuid": "^3.3.3"
}
}
}

24
packages/plugins/.nycrc Normal file
Просмотреть файл

@ -0,0 +1,24 @@
{
"extension": [
".ts",
".js"
],
"include": [
"src"
],
"exclude": [
"**/node_modules/**",
"**/tests/**",
"**/coverage/**",
"**/*.d.ts"
],
"reporter": [
"html",
"lcov",
"text"
],
"all": true,
"cache": true,
"extends": "@istanbuljs/nyc-config-typescript",
"check-coverage": false
}

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

@ -58,7 +58,6 @@
"clean": "rimraf ./.nyc_output ./lib ./package-lock.json ./tsconfig.tsbuildinfo",
"test": "mocha",
"coverage": "nyc npm run test",
"report:coverage": "npm run coverage && nyc report --reporter=text-lcov | coveralls",
"doc": "npm run build && npm run doc:readme && rimraf oclif.manifest.json",
"doc:readme": "oclif-dev manifest && oclif-dev readme",
"version": "npm run doc:readme && git add README.md"

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

@ -13,11 +13,12 @@
"**/*.d.ts"
],
"reporter": [
"text",
"html"
"html",
"lcov",
"text"
],
"all": true,
"cache": true,
"extends": "@istanbuljs/nyc-config-typescript",
"check-coverage": false
}
}

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

@ -28,13 +28,12 @@
"scripts": {
"postpack": "rimraf oclif.manifest.json",
"posttest": "",
"build":"tsc -b",
"clean":"rimraf ./.nyc_output ./lib ./package-lock.json ./tsconfig.tsbuildinfo",
"build": "tsc -b",
"clean": "rimraf ./.nyc_output ./lib ./package-lock.json ./tsconfig.tsbuildinfo",
"test": "mocha",
"coverage": "nyc npm run test",
"report:coverage":"npm run coverage && nyc report --reporter=text-lcov | coveralls",
"doc": "npm run build && npm run doc:readme && rimraf oclif.manifest.json",
"doc:readme":"oclif-dev manifest && oclif-dev readme",
"doc:readme": "oclif-dev manifest && oclif-dev readme",
"version": "npm run doc:readme && git add README.md"
},
"dependencies": {