angular - 业力并行 npm 包不适用于圆形 CI
问题描述
我正在使用 karma-parallel npm 包在 Angular 应用程序上运行 karma 单元测试。它在我的本地机器上就像一个魅力,并大大减少了构建时间。但是,当我在 Circle CI 上运行单元测试用例时,它似乎失败了。
我仍在查看 Circle CI 是否支持 karma-parallel 但我还没有找到任何东西
My Karma.conf.js file looks like this:
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['parallel', 'jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-parallel'),
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-spec-reporter'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular-devkit/build-angular/plugins/karma')
],
parallelOptions: {
executors: 2,
shardStrategy: 'round-robin'
})};
Expected Behavior: The unit tests should run in parallel on the circle CI as they do on my local machine.
Actual Behavior: The unit test fails on the circle CI and I get the following error:
Error: spawn ENOMEM
at ChildProcess.spawn (internal/child_process.js:366:11)
at spawn (child_process.js:538:9)
at Object.fork (child_process.js:113:10)
at fork (/home/circleci/project/node_modules/worker-farm/lib/fork.js:17:36)
at Farm.startChild (/home/circleci/project/node_modules/worker-farm/lib/farm.js:107:16)
at Farm.processQueue (/home/circleci/project/node_modules/worker-farm/lib/farm.js:288:10)
at Farm.<anonymous> (/home/circleci/project/node_modules/worker-farm/lib/farm.js:98:21)
at ontimeout (timers.js:436:11)
at tryOnTimeout (timers.js:300:5)
at listOnTimeout (timers.js:263:5)
at Timer.processTimers (timers.js:223:10)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! test-app@0.0.0 build: `node --max_old_space_size=8096 node_modules/@angular/cli/bin/ng build --prod --source-map=false --watch=false "-c=qa"`
npm ERR! Exit status 1
解决方案
推荐阅读
- python-3.x - 多次重复循环中的每个语句Python
- vuejs2 - 如何在 VueJs 中实现脏状态
- reactjs - 从 action.payload 获取 [object object]
- vba - 无法将值从 Excel 复制到 Word vba
- c++ - `std::string` 是否在内部将其字符存储为签名字符?
- javascript - 如何从反应活动导航到 Java 活动
- c++ - 功能 freopen 未读取输入
- unity3d - 材质没有纹理属性“_RendererColor”
- php - 当我将 json_decode() (在非关联模式下)转换为对象时,为什么“标量”会像这样出现?
- sql-server - TSQL - 多列上的动态数据透视