- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在 Linux 服务器上安装了 Jenkins(我没有 docker 容器,只是一个普通服务器)。我安装了所有建议的插件,以便为 Java 和 Angular 应用程序自动化。
现在我在运行 cypress tests 时遇到问题.我可以构建 Angular 应用程序,但是在 headless 模式下运行 cypress test 时遇到了问题。
我创建了一个“自由式项目”(不是管道),只是为了运行测试。
这是我的 Angular 项目中的相关脚本部分:
"scripts": {
"build": "ng build",
"start": "ng serve --port 3030",
"test": "start-server-and-test start http://localhost:3030 cy:run",
"cy:run": "cypress run",
"lint": "ng lint",
"e2e": "ng e2e"
},
npm install
npm WARN deprecated popper.js@1.16.1: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
> websocket@1.0.31 install /var/lib/jenkins/workspace/angular test/node_modules/websocket
> (node-gyp rebuild 2> builderror.log) || (exit 0)
make: Entering directory '/var/lib/jenkins/workspace/angular test/node_modules/websocket/build'
CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
SOLINK_MODULE(target) Release/obj.target/bufferutil.node
COPY Release/bufferutil.node
CXX(target) Release/obj.target/validation/src/validation.o
SOLINK_MODULE(target) Release/obj.target/validation.node
COPY Release/validation.node
make: Leaving directory '/var/lib/jenkins/workspace/angular test/node_modules/websocket/build'
> node-sass@4.13.1 install /var/lib/jenkins/workspace/angular test/node_modules/node-sass
> node scripts/install.js
Cached binary found at /var/lib/jenkins/.npm/node-sass/4.13.1/linux-x64-72_binding.node
> core-js@3.6.4 postinstall /var/lib/jenkins/workspace/angular test/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"
> @angular/cli@9.1.1 postinstall /var/lib/jenkins/workspace/angular test/node_modules/@angular/cli
> node ./bin/postinstall/script.js
> cypress@4.3.0 postinstall /var/lib/jenkins/workspace/angular test/node_modules/cypress
> node index.js --exec install
Cypress 4.3.0 is installed in /var/lib/jenkins/.cache/Cypress/4.3.0
> ngx-infinite-scroll@8.0.1 postinstall /var/lib/jenkins/workspace/angular test/node_modules/ngx-infinite-scroll
> opencollective-postinstall || exit 0
[96m[1mThank you for using ngx-infinite-scroll![96m[1m
[0m[96mIf you rely on this package, please consider supporting our open collective:[22m[39m
> [94mhttps://opencollective.com/ngx-infinite-scroll/donate[0m
> node-sass@4.13.1 postinstall /var/lib/jenkins/workspace/angular test/node_modules/node-sass
> node scripts/build.js
Binary found at /var/lib/jenkins/workspace/angular test/node_modules/node-sass/vendor/linux-x64-72/binding.node
Testing binary
Binary is fine
npm notice created a lockfile as package-lock.json. You should commit this file.
added 1799 packages from 1690 contributors and audited 20778 packages in 73.931s
51 packages are looking for funding
run `npm fund` for details
found 3 low severity vulnerabilities
run `npm audit fix` to fix them, or `npm audit` for details
+ npm run test
> test@0.0.6-b04032020 test /var/lib/jenkins/workspace/angular test
> start-server-and-test start http://localhost:3030 cy:run
starting server using command "npm run start"
and when url "[ 'http://localhost:3030' ]" is responding with HTTP status code 200
running tests using command "npm run cy:run"
> test@0.0.6-b04032020 start /var/lib/jenkins/workspace/angular test
> ng serve --port 3030
WARNING: This is a simple server for use in testing or debugging Angular applications
locally. It hasn't been reviewed for security issues.
Binding this server to an open connection can result in compromising your application or
computer. Using a different host than the one passed to the "--host" flag might result in
websocket connection issues. You might need to use "--disableHostCheck" if that's the
case.
Compiling @angular/core : es2015 as esm2015
Compiling @angular/common : es2015 as esm2015
Compiling @angular/animations : es2015 as esm2015
Compiling @angular/forms : es2015 as esm2015
Compiling @angular/cdk/platform : es2015 as esm2015
Compiling @angular/cdk/bidi : es2015 as esm2015
Compiling @angular/platform-browser : es2015 as esm2015
Compiling @angular/router : es2015 as esm2015
Compiling primeng/dom : es2015 as esm2015
Compiling primeng/api : es2015 as esm2015
Compiling @angular/animations/browser : es2015 as esm2015
Compiling @angular/cdk/keycodes : es2015 as esm2015
Compiling @angular/cdk/observers : es2015 as esm2015
Compiling @angular/cdk/a11y : es2015 as esm2015
Compiling @angular/platform-browser/animations : es2015 as esm2015
Compiling @angular/material/core : es2015 as esm2015
Compiling @angular/cdk/collections : es2015 as esm2015
Compiling @angular/cdk/scrolling : es2015 as esm2015
Compiling @angular/cdk/portal : es2015 as esm2015
Compiling primeng/utils : es2015 as esm2015
Compiling @angular/common/http : es2015 as esm2015
Compiling @angular/cdk/overlay : es2015 as esm2015
Compiling primeng/button : es2015 as esm2015
Compiling @angular/material/form-field : es2015 as esm2015
Compiling primeng/tooltip : es2015 as esm2015
Compiling @angular/material/button : es2015 as esm2015
Compiling @angular/cdk/layout : es2015 as esm2015
Compiling primeng/inputtext : es2015 as esm2015
Compiling primeng/dropdown : es2015 as esm2015
Compiling @angular/common : es2015 as esm2015
Compiling primeng/paginator : es2015 as esm2015
Compiling @angular/cdk/text-field : es2015 as esm2015
Compiling @angular/platform-browser-dynamic : es2015 as esm2015
Compiling @angular/material/input : es2015 as esm2015
Compiling @angular/material/icon : es2015 as esm2015
Compiling @angular/material/select : es2015 as esm2015
Compiling @angular/material/tooltip : es2015 as esm2015
Compiling @angular/core/testing : es2015 as esm2015
Compiling @angular/platform-browser/testing : es2015 as esm2015
Compiling @angular/compiler/testing : es2015 as esm2015
Compiling primeng/focustrap : es2015 as esm2015
Compiling primeng/messages : es2015 as esm2015
Compiling primeng/progressbar : es2015 as esm2015
Compiling @angular/material/dialog : es2015 as esm2015
Compiling @angular/cdk/accordion : es2015 as esm2015
Compiling @angular/material/divider : es2015 as esm2015
Compiling @angular/cdk/stepper : es2015 as esm2015
Compiling @angular/cdk/table : es2015 as esm2015
Compiling @angular/material/paginator : es2015 as esm2015
Compiling @angular/material/sort : es2015 as esm2015
Compiling @angular/cdk/tree : es2015 as esm2015
Compiling @angular/platform-browser-dynamic/testing : es2015 as esm2015
Compiling @angular/platform-server : es2015 as esm2015
Compiling @angular/common/testing : es2015 as esm2015
Compiling @ngx-translate/core : es2015 as esm2015
Compiling @angular/common/http : es2015 as esm2015
Compiling ngx-highlightjs : es2015 as esm2015
Compiling primeng/accordion : es2015 as esm2015
Compiling primeng/autocomplete : es2015 as esm2015
Compiling primeng/blockui : es2015 as esm2015
Compiling primeng/breadcrumb : es2015 as esm2015
Compiling primeng/calendar : es2015 as esm2015
Compiling primeng/captcha : es2015 as esm2015
Compiling primeng/card : es2015 as esm2015
Compiling primeng/carousel : es2015 as esm2015
Compiling primeng/chart : es2015 as esm2015
Compiling primeng/checkbox : es2015 as esm2015
Compiling primeng/chips : es2015 as esm2015
Compiling primeng/codehighlighter : es2015 as esm2015
Compiling primeng/colorpicker : es2015 as esm2015
Compiling primeng/confirmdialog : es2015 as esm2015
Compiling primeng/contextmenu : es2015 as esm2015
Compiling primeng/dataview : es2015 as esm2015
Compiling primeng/defer : es2015 as esm2015
Compiling primeng/dialog : es2015 as esm2015
Compiling primeng/dragdrop : es2015 as esm2015
Compiling primeng/dynamicdialog : es2015 as esm2015
Compiling primeng/editor : es2015 as esm2015
Compiling primeng/fieldset : es2015 as esm2015
Compiling primeng/fileupload : es2015 as esm2015
Compiling primeng/fullcalendar : es2015 as esm2015
Compiling primeng/galleria : es2015 as esm2015
Compiling primeng/gmap : es2015 as esm2015
Compiling primeng/inplace : es2015 as esm2015
Compiling primeng/inputmask : es2015 as esm2015
Compiling primeng/inputswitch : es2015 as esm2015
Compiling primeng/inputtextarea : es2015 as esm2015
Compiling primeng/keyfilter : es2015 as esm2015
Compiling primeng/lightbox : es2015 as esm2015
Compiling primeng/listbox : es2015 as esm2015
Compiling primeng/megamenu : es2015 as esm2015
Compiling primeng/menu : es2015 as esm2015
Compiling primeng/menubar : es2015 as esm2015
Compiling primeng/message : es2015 as esm2015
Compiling primeng/multiselect : es2015 as esm2015
Compiling primeng/orderlist : es2015 as esm2015
Compiling primeng/organizationchart : es2015 as esm2015
Compiling primeng/overlaypanel : es2015 as esm2015
Compiling primeng/panel : es2015 as esm2015
Compiling primeng/panelmenu : es2015 as esm2015
Compiling primeng/password : es2015 as esm2015
Compiling primeng/picklist : es2015 as esm2015
Compiling primeng/progressspinner : es2015 as esm2015
Compiling primeng/radiobutton : es2015 as esm2015
Compiling primeng/rating : es2015 as esm2015
Compiling primeng/scrollpanel : es2015 as esm2015
Compiling primeng/selectbutton : es2015 as esm2015
Compiling primeng/sidebar : es2015 as esm2015
Compiling primeng/slidemenu : es2015 as esm2015
Compiling primeng/slider : es2015 as esm2015
Compiling primeng/spinner : es2015 as esm2015
Compiling primeng/splitbutton : es2015 as esm2015
Compiling primeng/steps : es2015 as esm2015
Compiling primeng/table : es2015 as esm2015
Compiling primeng/tabmenu : es2015 as esm2015
Compiling primeng/tabview : es2015 as esm2015
Compiling primeng/terminal : es2015 as esm2015
Compiling primeng/tieredmenu : es2015 as esm2015
Compiling primeng/toast : es2015 as esm2015
Compiling primeng/togglebutton : es2015 as esm2015
Compiling primeng/toolbar : es2015 as esm2015
Compiling primeng/tree : es2015 as esm2015
Compiling primeng/treetable : es2015 as esm2015
Compiling primeng/tristatecheckbox : es2015 as esm2015
Compiling primeng/virtualscroller : es2015 as esm2015
Compiling @angular/animations/browser/testing : es2015 as esm2015
Compiling @angular/cdk/clipboard : es2015 as esm2015
Compiling @angular/cdk/drag-drop : es2015 as esm2015
Compiling @angular/common/http/testing : es2015 as esm2015
Compiling @angular/material/autocomplete : es2015 as esm2015
Compiling @angular/material/badge : es2015 as esm2015
Compiling @angular/material/bottom-sheet : es2015 as esm2015
Compiling @angular/material/button-toggle : es2015 as esm2015
Compiling @angular/material/card : es2015 as esm2015
Compiling @angular/material/checkbox : es2015 as esm2015
Compiling @angular/material/chips : es2015 as esm2015
Compiling @angular/material/datepicker : es2015 as esm2015
Compiling @angular/material/expansion : es2015 as esm2015
Compiling @angular/material/grid-list : es2015 as esm2015
Compiling @angular/material/icon/testing : es2015 as esm2015
Compiling @angular/material/list : es2015 as esm2015
Compiling @angular/material/menu : es2015 as esm2015
Compiling @angular/material/progress-bar : es2015 as esm2015
Compiling @angular/material/progress-spinner : es2015 as esm2015
Compiling @angular/material/radio : es2015 as esm2015
Compiling @angular/material/sidenav : es2015 as esm2015
Compiling @angular/material/slide-toggle : es2015 as esm2015
Compiling @angular/material/slider : es2015 as esm2015
Compiling @angular/material/snack-bar : es2015 as esm2015
Compiling @angular/material/stepper : es2015 as esm2015
Compiling @angular/material/table : es2015 as esm2015
Compiling @angular/material/tabs : es2015 as esm2015
Compiling @angular/material/toolbar : es2015 as esm2015
Compiling @angular/material/tree : es2015 as esm2015
Compiling @angular/material-moment-adapter : es2015 as esm2015
Compiling @angular/platform-server/testing : es2015 as esm2015
Compiling @angular/router/testing : es2015 as esm2015
Compiling @angular/service-worker : es2015 as esm2015
Compiling @angular/service-worker/config : es2015 as esm2015
Compiling @auth0/angular-jwt : module as esm5
Compiling @fullcalendar/angular : es2015 as esm2015
Compiling @ngx-translate/http-loader : es2015 as esm2015
Compiling angularx-qrcode : es2015 as esm2015
Compiling @angular/common/http/testing : es2015 as esm2015
Compiling @angular/common/testing : es2015 as esm2015
Compiling material-community-components : es2015 as esm2015
Compiling ng-lazyload-image : es2015 as esm2015
Compiling ng2-ckeditor : es2015 as esm2015
Compiling ng2-tel-input : es2015 as esm2015
Compiling ngx-barcode6 : es2015 as esm2015
Compiling ngx-cookie-service : es2015 as esm2015
Compiling ngx-daterangepicker-material : es2015 as esm2015
Compiling ngx-device-detector : es2015 as esm2015
Compiling ngx-highlightjs/plus : es2015 as esm2015
Compiling ngx-image-zoom : es2015 as esm2015
Compiling ngx-infinite-scroll : es2015 as esm2015
Compiling ngx-loading : es2015 as esm2015
Compiling primeng : es2015 as esm2015
Error: Timeout
at MergeMapSubscriber.project (/var/lib/jenkins/workspace/angular test/node_modules/wait-on/lib/wait-on.js:145:74)
at MergeMapSubscriber._tryNext (/var/lib/jenkins/workspace/angular test/node_modules/rxjs/internal/operators/mergeMap.js:69:27)
at MergeMapSubscriber._next (/var/lib/jenkins/workspace/angular test/node_modules/rxjs/internal/operators/mergeMap.js:59:18)
at MergeMapSubscriber.Subscriber.next (/var/lib/jenkins/workspace/angular test/node_modules/rxjs/internal/Subscriber.js:66:18)
at AsyncAction.dispatch [as work] (/var/lib/jenkins/workspace/angular test/node_modules/rxjs/internal/observable/timer.js:31:16)
at AsyncAction._execute (/var/lib/jenkins/workspace/angular test/node_modules/rxjs/internal/scheduler/AsyncAction.js:71:18)
at AsyncAction.execute (/var/lib/jenkins/workspace/angular test/node_modules/rxjs/internal/scheduler/AsyncAction.js:59:26)
at AsyncScheduler.flush (/var/lib/jenkins/workspace/angular test/node_modules/rxjs/internal/scheduler/AsyncScheduler.js:52:32)
at listOnTimeout (internal/timers.js:549:17)
at processTimers (internal/timers.js:492:7)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! test@0.0.6-b04032020 test: `start-server-and-test start http://localhost:3030 cy:run`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the test@0.0.6-b04032020 test script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /var/lib/jenkins/.npm/_logs/2020-04-09T11_06_30_762Z-debug.log
Build step 'Execute shell' marked build as failure
Finished: FAILURE
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli '/opt/local/node/node-v12.16.1-linux-x64/bin/node',
1 verbose cli '/opt/local/node/12/bin/npm',
1 verbose cli 'run',
1 verbose cli 'test'
1 verbose cli ]
2 info using npm@6.13.4
3 info using node@v12.16.1
4 verbose run-script [ 'pretest', 'test', 'posttest' ]
5 info lifecycle test@0.0.6~pretest: test@0.0.6
6 info lifecycle test@0.0.6~test: test@0.0.6
7 verbose lifecycle test@0.0.6~test: unsafe-perm in lifecycle true
8 verbose lifecycle test@0.0.6~test: PATH: /opt/local/node/node-v12.16.1-linux-x64/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/var/lib/jenkins/workspace/angular test/node_modules/.bin:/opt/local/node/12/bin:/opt/local/java/8.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
9 verbose lifecycle test@0.0.6~test: CWD: /var/lib/jenkins/workspace/angular test
10 silly lifecycle test@0.0.6~test: Args: [ '-c', 'start-server-and-test start http://localhost:3030 cy:run' ]
11 silly lifecycle test@0.0.6~test: Returned: code: 1 signal: null
12 info lifecycle test@0.0.6~test: Failed to exec test script
13 verbose stack Error: test@0.0.6 test: `start-server-and-test start http://localhost:3030 cy:run`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (/opt/local/node/node-v12.16.1-linux-x64/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:311:20)
13 verbose stack at ChildProcess.<anonymous> (/opt/local/node/node-v12.16.1-linux-x64/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:311:20)
13 verbose stack at maybeClose (internal/child_process.js:1021:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
14 verbose pkgid test@0.0.6
15 verbose cwd /var/lib/jenkins/workspace/angular test
16 verbose Linux 4.15.0-96-generic
17 verbose argv "/opt/local/node/node-v12.16.1-linux-x64/bin/node" "/opt/local/node/12/bin/npm" "run" "test"
18 verbose node v12.16.1
19 verbose npm v6.13.4
20 error code ELIFECYCLE
21 error errno 1
22 error test@0.0.6 test: `start-server-and-test start http://localhost:3030 cy:run`
22 error Exit status 1
23 error Failed at the test@0.0.6 test script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
最佳答案
虽然从错误消息中看并不明显,但您似乎遇到了 timeout为 start-server-and-test
.由于启动服务器似乎包括编译步骤,因此可能需要一些时间。您可以通过设置环境变量 WAITON_TIMEOUT
来增加超时时间(默认为 5 分钟)。到所需的超时(以毫秒为单位)。或者,您可以进行静态构建并由除开发服务器以外的其他工具提供服务。例如快速服务器。
关于angular - Jenkins 运行 Cypress 测试以超时结束,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61120755/
我获得了一些源代码示例,我想测试一些功能。不幸的是,我在执行程序时遇到问题: 11:41:31 [linqus@ottsrvafq1 example]$ javac -g test/test.jav
我想测试ggplot生成的两个图是否相同。一种选择是在绘图对象上使用all.equal,但我宁愿进行更艰巨的测试以确保它们相同,这似乎是identical()为我提供的东西。 但是,当我测试使用相同d
我确实使用 JUnit5 执行我的 Maven 测试,其中所有测试类都有 @ExtendWith({ProcessExtension.class}) 注释。如果是这种情况,此扩展必须根据特殊逻辑使测试
在开始使用 Node.js 开发有用的东西之前,您的流程是什么?您是否在 VowJS、Expresso 上创建测试?你使用 Selenium 测试吗?什么时候? 我有兴趣获得一个很好的工作流程来开发我
这个问题已经有答案了: What is a NullPointerException, and how do I fix it? (12 个回答) 已关闭 3 年前。 基于示例here ,我尝试为我的
我正在考虑测试一些 Vue.js 组件,作为 Laravel 应用程序的一部分。所以,我有一个在 Blade 模板中使用并生成 GET 的组件。在 mounted 期间请求生命周期钩子(Hook)。假
考虑以下程序: #include struct Test { int a; }; int main() { Test t=Test(); std::cout<
我目前的立场是:如果我使用 web 测试(在我的例子中可能是通过 VS.NET'08 测试工具和 WatiN)以及代码覆盖率和广泛的数据来彻底测试我的 ASP.NET 应用程序,我应该不需要编写单独的
我正在使用 C#、.NET 4.7 我有 3 个字符串,即。 [test.1, test.10, test.2] 我需要对它们进行排序以获得: test.1 test.2 test.10 我可能会得到
我有一个 ID 为“rv_list”的 RecyclerView。单击任何 RecyclerView 项目时,每个项目内都有一个可见的 id 为“star”的 View 。 我想用 expresso
我正在使用 Jest 和模拟器测试 Firebase 函数,尽管这些测试可能来自竞争条件。所谓 flakey,我的意思是有时它们会通过,有时不会,即使在同一台机器上也是如此。 测试和函数是用 Type
我在测试我与 typeahead.js ( https://github.com/angular-ui/bootstrap/blob/master/src/typeahead/typeahead.js
我正在尝试使用 Teamcity 自动运行测试,但似乎当代理编译项目时,它没有正确完成,因为当我运行运行测试之类的命令时,我收到以下错误: fatal error: 'Pushwoosh/PushNo
这是我第一次玩 cucumber ,还创建了一个测试和 API 的套件。我的问题是在测试 API 时是否需要运行它? 例如我脑子里有这个, 启动 express 服务器作为后台任务 然后当它启动时(我
我有我的主要应用程序项目,然后是我的测试的第二个项目。将所有类型的测试存储在该测试项目中是一种好的做法,还是应该将一些测试驻留在主应用程序项目中? 我应该在我的主项目中保留 POJO JUnit(测试
我正在努力弄清楚如何实现这个计数。模型是用户、测试、等级 用户 has_many 测试,测试 has_many 成绩。 每个等级都有一个计算分数(strong_pass、pass、fail、stron
我正在尝试测试一些涉及 OkHttp3 的下载代码,但不幸失败了。目标:测试 下载图像文件并验证其是否有效。平台:安卓。此代码可在生产环境中运行,但测试代码没有任何意义。 产品代码 class Fil
当我想为 iOS 运行 UI 测试时,我收到以下消息: SetUp : System.Exception : Unable to determine simulator version for X 堆
我正在使用 Firebase Remote Config 在 iOS 上设置 A/B 测试。 一切都已设置完毕,我正在 iOS 应用程序中读取服务器端默认值。 但是在多个模拟器上尝试,它们都读取了默认
[已编辑]:我已经用 promise 方式更改了我的代码。 我正在写 React with this starter 由 facebook 创建,我是测试方面的新手。 现在我有一个关于图像的组件,它有
我是一名优秀的程序员,十分优秀!