Node.js GITLAB:无法调试Nodejs Mocha测试失败
我正在运行以下环境:Node.js GITLAB:无法调试Nodejs Mocha测试失败,node.js,express,gitlab,gitlab-ci,gitlab-ci-runner,Node.js,Express,Gitlab,Gitlab Ci,Gitlab Ci Runner,我正在运行以下环境: GIT + Self hosted Gitlab Node.js + Express Mocha ( for tests ) Winston ( for logging) 命令: ./node_modules/.bin/mocha 在本地系统上对所有分支运行良好。但在gitlab的多个分支上(在其中一个分支上,它可以工作),同样的操作失败 所有my node.js异常都会转到日志/exceptions.log文件。 在本地系统上,我可以查看exceptions.log的
GIT + Self hosted Gitlab
Node.js + Express
Mocha ( for tests )
Winston ( for logging)
命令:
./node_modules/.bin/mocha
在本地系统上对所有分支运行良好。但在gitlab的多个分支上(在其中一个分支上,它可以工作),同样的操作失败
所有my node.js异常都会转到日志/exceptions.log文件。
在本地系统上,我可以查看exceptions.log的内容以找出问题所在,但在Gitlab=>PipeLines上,我无法查看此文件
如果我能在Gitlab上看到exceptions.log文件内容,我就能找出问题所在
这是我的.gitlab ci文件:
image: node:6
services:
- postgres:latest
variables:
POSTGRES_DB: test
POSTGRES_USER: nodeapp
POSTGRES_PASSWORD: ""
stages:
# Install necessary dependencies.
- build
# Run tests
- test
# Clean up dependencies if build fails.
- build_cleanup
cache:
key: XYZ_Cache_03_05_2018
paths:
- node_modules/
# Job: Build
# Checks & Installs dependencies.
build:
stage: build
script:
# check & install apt-get
- 'which apt-get || ( apt-get update )'
# check & install node
- 'which node || ( apt-get -y install nodejs --silent )'
# check & install npm
- 'which npm || ( apt-get -y install npm --silent )'
allow_failure: false
# Job: Test
# Run tests against our application
# If this fails, we do not deploy
test:
stage: test
script:
- npm install
- npm install -y --global bower --silent
- bower install --allow-root --silent
- npm install --global gulp-cli
- npm install mocha
- ./node_modules/mocha/bin/mocha
allow_failure: false
build_cleanup:
stage: build_cleanup
script:
- rm -rf node_modules
when: on_failure