0
私はコードカバレッジツールとしてリポジトリにcodecovを設定しようとしています。ただし、トラビスCIテストに合格していますが、コーデックレポートは表示されません。ここにトラビス報告書のリンク - https://travis-ci.org/fossasia/susper.com/builds/213793203(bash <(curl -s https://codecov.io/bash)
参照)があります。私は何をすべきか?なぜcodecovがコメントにレポートを表示しないのですか?
package.json
{
"name": "susper",
"version": "0.0.0",
"license": "MIT",
"angular-cli": {},
"scripts": {
"start": "ng serve",
"lint": "tslint \"src/**/*.ts\"",
"test": "ng test",
"pree2e": "webdriver-manager update",
"e2e": "protractor"
},
"private": true,
"dependencies": {
"@angular/common": "2.4.0",
"@angular/compiler": "2.4.0",
"@angular/core": "2.4.0",
"@angular/forms": "2.4.0",
"@angular/http": "2.4.0",
"@angular/platform-browser": "2.4.0",
"@angular/platform-browser-dynamic": "2.4.0",
"@angular/router": "3.4.0",
"@ngrx/core": "^1.2.0",
"@ngrx/effects": "^2.0.0",
"@ngrx/router-store": "^1.2.5",
"@ngrx/store": "^2.2.1",
"@ngrx/store-devtools": "^3.2.3",
"core-js": "^2.4.1",
"ngrx-store-freeze": "^0.1.6",
"reselect": "^2.5.4",
"rxjs": "5.0.0-beta.12",
"ts-helpers": "^1.1.1",
"zone.js": "^0.6.23"
},
"devDependencies": {
"@angular/compiler-cli": "2.4.0",
"@types/jasmine": "2.5.38",
"@types/node": "^6.0.42",
"angular-cli": "1.0.0-beta.24",
+ "codecov.io": "^0.1.6",
"codelyzer": "~2.0.0-beta.1",
"jasmine-core": "2.5.2",
"jasmine-spec-reporter": "2.5.0",
- "karma": "1.2.0",
+ "karma": "^1.2.0",
"karma-chrome-launcher": "^2.0.0",
"karma-cli": "^1.0.1",
+ "karma-coverage": "^1.1.1",
"karma-jasmine": "^1.0.2",
"karma-remap-istanbul": "^0.2.1",
"protractor": "4.0.9",
"ts-node": "1.2.1",
"tslint": "^4.0.2",
"typescript": "~2.0.3",
"webdriver-manager": "10.2.5"
}
}
travis.yml
sudo: required
dist: trusty
language: node_js
node_js:
- 6
before_install:
- export CHROME_BIN=chromium-browser
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
+- pip install --user codecov
before_script:
- ng build
script:
- ng lint
- >
docker run -ti -v $(pwd):/app --workdir=/app coala/base coala --version
after_success:
- bash ./deploy.sh
+- bash <(curl -s https://codecov.io/bash)
cache:
bundler: true
directories:
- node_modules
- .coala-cache
services: docker
branches:
only:
- angular
karma.conf.js
// Karma configuration file, see link for more information
// https://karma-runner.github.io/0.13/config/configuration-file.html
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', 'angular-cli'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-remap-istanbul'),
- require('angular-cli/plugins/karma')
+ require('angular-cli/plugins/karma'),
+ require('karma-coverage')
],
files: [
{ pattern: './src/test.ts', watched: false }
],
preprocessors: {
- './src/test.ts': ['angular-cli']
+ './src/test.ts': ['angular-cli'],
+ 'src/app/**/*.js': ['coverage']
},
mime: {
'text/x-typescript': ['ts','tsx']
},
remapIstanbulReporter: {
reports: {
html: 'coverage',
lcovonly: './coverage/coverage.lcov'
}
},
+ coverageReporter: {
+ type : 'lcov',
+ dir : 'coverage/'
+ },
angularCli: {
config: './angular-cli.json',
environment: 'dev'
},
reporters: config.angularCli && config.angularCli.codeCoverage
? ['progress', 'karma-remap-istanbul']
- : ['progress'],
+ : ['progress', 'coverage'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false
});
};
- ここ
は、ソースコードであります
{
"compilerOptions": {
"baseUrl": "",
"declaration": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": ["es6", "dom"],
"mapRoot": "./",
"module": "es6",
"moduleResolution": "node",
"outDir": "../dist/out-tsc",
"sourceMap": true,
"target": "es5",
"typeRoots": [
"../node_modules/@types"
]
}
}
ありがとう、私の質問に時間を与えるために。 :)私は混乱しています、そして、ドッカーのコンテナからcodecovレポートを渡すことができるように私のコードでどうすればいいですか? –
実際、ここではhttps://docs.codecov.io/docs/testing-with-dockerで 'docker run $ ci_env ...'とここに - https://github.com/codecov/support/wikiを使用しています/ Testing-with-Dockerあなたは 'docker run $ ci_env'を書いています。どちらを選ぶべきですか?そして、travis.ymlの中でそれらを書ける場所はどこですか?どの段階で正確に判断できませんか? –
私はラインを追加しようとしましたが、私はこのtravisレポートを入手しました - https://travis-ci.org/fossasia/susper.com/builds/214350499 –