我使用 angular 7 cli 生成了一个全新的空项目。第一步是设置 Circle CI 来测试项目。
当我在我的电脑上运行它时,没问题:
npm run lint
npm run e2e
测试成功。
所以我把同样的东西放在我的circleci配置文件中:
# Javascript Node CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#
version: 2
jobs:
build:
docker:
# specify the version you desire here
- image: circleci/node:8.12.0
# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
# documented at https://circleci.com/docs/2.0/circleci-images/
# - image: circleci/mongo:3.4.4
working_directory: ~/new_project
steps:
- checkout
# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- run: npm install
- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}
# run tests!
- run: npm run lint
- run: npm run e2e
当 CircleCi 运行它时,它失败了:
[09:01:05] I/update - chromedriver: unzipping chromedriver_2.45.zip
[09:01:05] I/update - chromedriver: setting permissions to 0755 for /home/circleci/bailleur-indep-extranet/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.45
[09:01:05] I/launcher - Running 1 instances of WebDriver
[09:01:05] I/direct - Using ChromeDriver directly...
[09:01:05] E/launcher - Server terminated early with status 127
[09:01:05] E/launcher - Error: Server terminated early with status 127
at earlyTermination.catch.e (/home/circleci/bailleur-indep-extranet/node_modules/selenium-webdriver/remote/index.js:252:52)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:189:7)
From: Task: WebDriver.createSession()
at Function.createSession (/home/circleci/bailleur-indep-extranet/node_modules/selenium-webdriver/lib/webdriver.js:769:24)
at Function.createSession (/home/circleci/bailleur-indep-extranet/node_modules/selenium-webdriver/chrome.js:761:15)
at Direct.getNewDriver (/home/circleci/bailleur-indep-extranet/node_modules/protractor/built/driverProviders/direct.js:77:33)
at Runner.createBrowser (/home/circleci/bailleur-indep-extranet/node_modules/protractor/built/runner.js:195:43)
at q.then.then (/home/circleci/bailleur-indep-extranet/node_modules/protractor/built/runner.js:339:29)
at _fulfilled (/home/circleci/bailleur-indep-extranet/node_modules/q/q.js:834:54)
at self.promiseDispatch.done (/home/circleci/bailleur-indep-extranet/node_modules/q/q.js:863:30)
at Promise.promise.promiseDispatch (/home/circleci/bailleur-indep-extranet/node_modules/q/q.js:796:13)
at /home/circleci/bailleur-indep-extranet/node_modules/q/q.js:556:49
at runSingle (/home/circleci/bailleur-indep-extranet/node_modules/q/q.js:137:13)
[09:01:05] E/launcher - Process exited with error code 199
An unexpected error occurred: undefined
看来测试 angular 过程的 build 部分进展顺利,没有警告,没有错误,只有经典的 angular 构建日志。
版本: - node:8.12.0 - @angular/cli:7.2.0(也发生过,但也没有解决,在 7.1.x 中) - npm:6.4.1
知道如何解决它吗?在此先感谢您的帮助和想法!