我的云构建在npm test上超时失败,没有任何有用的信息被发送到stdout。可以在文件中找到完整的日志,但我无法找到在云构建环境中使用ssh的方法。
Already have image: node
> project-client@v3.0.14 test
> jest
ts-jest[versions] (WARN) Version 4.1.0-beta of typescript installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version (>=3.8.0 <5.0.0-0). Please do not report issues in ts-jest if you are using unsupported versions.
npm ERR! path /workspace/v3/client
npm ERR! command failed
npm ERR! signal SIGTERM
npm ERR! command sh -c jest
npm ERR! A complete log of this run can be found in:
npm ERR! /builder/home/.npm/_logs/2020-11-09T07_56_23_573Z-debug.log由于我在本地运行测试没有问题,所以我希望看到这个2020-11-09T07_56_23_573Z-debug.log文件的内容,希望能得到可能出错的提示。
有检索文件内容的方法吗?
云构建environment?
发布于 2020-11-09 13:57:59
我在Gitlab CI上有一个类似的错误管理问题,我的解决方法也是从那里得到灵感的。
诀窍是将命令嵌入到使用返回代码0退出的东西中。这里有一个例子
- name: node
entrypoint: "bash"
args:
- "-c"
- |
RETURN_CODE=$$(jtest > log.stdout 2>log.stderr;echo $${?})
cat log.stdout
cat log.stderr
if [ $${RETURN_CODE} -gt 0 ];
then
#Do what you want in case of error, like a cat of the files in the _logs dir
# Break the build: exit 1
else
#Do what you want in case of success. Nothing to continue to the next step
fi一些解释:
interpreted.
。
https://stackoverflow.com/questions/64748096
复制相似问题