我们有一个 Node.js 开源存储库,并使用 Travis 进行单元测试、代码覆盖(使用 CodeCov)等。我们刚刚使用 Lernajs 对我们的应用程序采用了 monorepo 方法,并尝试将travis.yml
文件修改为:
language: node_js
node_js:
- "6"
before_install:
- sudo apt-key adv --keyserver pgp.mit.edu --recv D101F7899D41F3C3
- echo "deb http://dl.yarnpkg.com/debian/ stable main" | sudo tee
/etc/apt/sources.list.d/yarn.list
- sudo apt-get update -qq
- sudo apt-get install -y -qq yarn
- yarn && lerna bootstrap --concurrency=1
- npm install -g codecov
cache:
directories:
- $HOME/.yarn-cache
jobs:
include:
- stage: ES Lint & Flow
script: lerna run lint && lerna run flow
- stage: Unit Tests
script: lerna test && lerna install -g codecov && lerna run coverage
我们曾经before_install
为 Lerna 和 Yarn 准备 Travis 代理。这些阶段工作正常,但问题是它没有将报告上传到显示错误的 codecov:
[error] "2017-09-16T10:57:52.285Z" { ValidationError: "value" is not allowed to be empty
at Object.exports.process (/home/travis/build/BlueEastCode/bluerain-os/packages/bluerain-os/node_modules/joi/lib/errors.js:140:17)
at internals.Any._validateWithOptions (/home/travis/build/BlueEastCode/bluerain-os/packages/bluerain-os/node_modules/joi/lib/any.js:654:25)
at root.validate (/home/travis/build/BlueEastCode/bluerain-os/packages/bluerain-os/node_modules/joi/lib/index.js:100:23)
at /home/travis/build/BlueEastCode/bluerain-os/packages/bluerain-os/node_modules/codacy-coverage/lib/impl/lcov.js:11:37
at tryCatcher (/home/travis/build/BlueEastCode/bluerain-os/packages/bluerain-os/node_modules/bluebird/js/main/util.js:26:23)
at Promise._resolveFromResolver (/home/travis/build/BlueEastCode/bluerain-os/packages/bluerain-os/node_modules/bluebird/js/main/promise.js:483:31)
at new Promise (/home/travis/build/BlueEastCode/bluerain-os/packages/bluerain-os/node_modules/bluebird/js/main/promise.js:71:37)
at Object.parseLcov [as parse] (/home/travis/build/BlueEastCode/bluerain-os/packages/bluerain-os/node_modules/codacy-coverage/lib/impl/lcov.js:9:20)
at Object.module.exports [as handleInput] (/home/travis/build/BlueEastCode/bluerain-os/packages/bluerain-os/node_modules/codacy-coverage/lib/handleInput.js:26:54)
at Socket.<anonymous> (/home/travis/build/BlueEastCode/bluerain-os/packages/bluerain-os/node_modules/codacy-coverage/bin/codacy-coverage.js:45:20)
at emitNone (events.js:91:20)
at Socket.emit (events.js:185:7)
at endReadableNT (_stream_readable.js:974:12)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickCallback (internal/process/next_tick.js:104:9)
有人对这个问题有任何想法吗?我们想解决这个保留 Lerna 的问题。