如何在 Codedeploy 中查看测试结果

How to see Test result in Codedeploy

我想在 codepipeline 中有一个测试阶段。为此,我创建了一个代码部署作为代码管道的一个阶段,appspec.yml 是:

version: 0.0
os: linux
files:
  - source: test
    destination: /mycodedeploy/test
hooks:
  AfterInstall:
    - location: test/run_test.sh
    - timeout: 3600

代码部署成功完成,但我在 AWS 控制台中没有看到 test/run_test.sh 的测试结果。 我在哪里可以看到测试结果?

"Ran 1 test in 0.000s

OK" 

?

除非您将实例配置为将日志发布到 CloudWatch,否则您将无法在 AWS 控制台中看到来自脚本的日志。

您应该能够在此处的主机上看到日志:/opt/codedeploy-agent/deployment-root/deployment-logs/codedeploy-agent-deployments.log。如果您不将它们发布到 CloudWatch,则必须手动查看主机。 Here's more information on CodeDeploy agent logging.