天天看点

SAP Spartacus cypress集成测试执行失败的一些常见原因

SAP Spartacus 端到端的集成测试代码实现,位于下列文件夹内:

SAP Spartacus cypress集成测试执行失败的一些常见原因

错误消息:

CypressError: cy.route cannot be invoked before starting the cy.server()

SAP Spartacus cypress集成测试执行失败的一些常见原因
测试覆盖率:
SAP Spartacus cypress集成测试执行失败的一些常见原因
先执行Spartacus B2B模块budget的集成测试:
SAP Spartacus cypress集成测试执行失败的一些常见原因
再执行cost center:
SAP Spartacus cypress集成测试执行失败的一些常见原因
这些集成测试的实现代码,位于integration/b2b/regression/my-company下面:
SAP Spartacus cypress集成测试执行失败的一些常见原因
再执行purchase limit:
SAP Spartacus cypress集成测试执行失败的一些常见原因
第一次build失败,我在Travis的控制台上点了Restart job,第二次就成功了:
SAP Spartacus cypress集成测试执行失败的一些常见原因
Coverage summary:测试覆盖率一览。
SAP Spartacus cypress集成测试执行失败的一些常见原因
这个build貌似还有超时的时间限制,若10分钟内没收到任何output,build就终止了。

No output has been received in the last 10m0s, this potentially indicates a stalled build or something wrong with the build itself.

1364Check the details on how to adjust your build configuration on: https://docs.travis-ci.com/user/common-build-problems/#build-times-out-because-no-output-was-received

1365

1366The build has been terminated

SAP Spartacus cypress集成测试执行失败的一些常见原因

成功消息:

Success: Spartacus production build was successful.

SAP Spartacus cypress集成测试执行失败的一些常见原因
Running Cypress end to end tests
1011yarn run v1.22.5
1012$ start-server-and-test start:ci:b2b http-get://localhost:4200 e2e:cy:run:ci:2005:b2b
10131: starting server using command "npm run start:ci:b2b"
1014and when url "[ 'http-get://localhost:4200' ]" is responding with HTTP status code 200
1015running tests using command "npm run e2e:cy:run:ci:2005:b2b"
1016
1017npm WARN lifecycle The node binary used for scripts is /tmp/yarn--1612152243389-0.11358567514273044/node but npm is using /home/travis/.nvm/versions/node/v12.16.1/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
1018
1019> [email protected] start:ci:b2b /home/travis/build/SAP/spartacus
1020> cross-env SPARTACUS_BASE_URL=https://spartacus-devci767.eastus.cloudapp.azure.com:9002 SPARTACUS_API_PREFIX=/occ/v2/ SPARTACUS_B2B=true yarn start
1021
1022$ ng serve
1023env= {
1024  SPARTACUS_API_PREFIX: '"/occ/v2/"',
1025  SPARTACUS_BASE_URL: '"https://spartacus-devci767.eastus.cloudapp.azure.com:9002"',
1026  SPARTACUS_B2B: '"true"'
1027}
           

下图可以看到ng serve 命令行启动时,如何通过环境变量的方式注入参数到启动命令行:

SAP Spartacus cypress集成测试执行失败的一些常见原因

开始运行集成测试:

SAP Spartacus cypress集成测试执行失败的一些常见原因

The command ./build.sh sonar exited with 0

这只是Travis build其中之一。