【发布时间】:2020-04-09 07:06:45
【问题描述】:
我已经根据域(用户、菜单、时间线......)在我的 Gitab CI 中将所有 cypress 测试拆分为不同的作业,这样我可以并行执行所有这些作业。
所以这项工作花费的时间比预期的要多。例如,没有执行任何测试的作业需要 15 分钟...
这是启动作业的命令:
docker run -v $PWD:/e2e -w /e2e --link=_nginx:myurl.test --net=_default cypress/included:3.4.0 node ./node_modules/.bin/cypress-tags run -e TAGS="${FEATURE_TAGS}" --config baseUrl=https://myurl.test --reporter junit --reporter-options "mochaFile=cypress/reports/[hash].xml"
也许有人知道如何禁用工作中那些无用的步骤。 谢谢。
编辑
解决方案是改用这个命令:
docker run -v $PWD:/e2e -w /e2e --link=_nginx:myurl.test --net=_default cypress/included:4.5.0 node ./node_modules/.bin/cypress run -env --spec ${SPEC} --config baseUrl=https://myurl.test --reporter junit --reporter-options "mochaFile=cypress/reports/[hash].xml"
所以主要的解决方案是使用--spec 而不是tags
【问题讨论】:
-
您的测试是否存储在文件中的特定目录中?
-
是的,我为每个测试存储了屏幕截图和视频
-
我只是删除了我的工件中视频的路径,它是一样的。我将尝试仅在失败时存储报告和屏幕截图。
标签: git testing continuous-integration gitlab gitlab-ci