简体   繁体   English

AWS Codepipeline - 运行集成测试

[英]AWS Codepipeline - run integration tests

first of all, sorry, if my question is to broad..., but I'm looking for solution approaches, instead of asking exact questions.首先,抱歉,如果我的问题太广泛...,但我正在寻找解决方法,而不是提出确切的问题。

Now, we are migrating our (c++) development into AWS (AWS CodeCommit, CodePipeline, etc).现在,我们正在将我们的 (c++) 开发迁移到 AWS(AWS CodeCommit、CodePipeline 等)。 The development workflow is very common: edit the code, build (the build executes UNIT Tests), and run integration test.开发工作流程很常见:编辑代码、构建(构建执行单元测试)和运行集成测试。

The integration test requires database, the running production process (single process application) and the test process.集成测试需要数据库、正在运行的生产进程(单进程应用)和测试进程。

Now, I have an AWS CodePipeline that is (in AWS CodePipeline stage order)现在,我有一个 AWS CodePipeline(按 AWS CodePipeline 阶段顺序)

  1. Check out the source if changed (AWS CodeCommit)如果发生更改,请检查源代码 (AWS CodeCommit)
  2. Build it and output the binaries (AWS CodeBuild)构建它和 output 二进制文件 (AWS CodeBuild)
  3. Create 2 docker images (for production process and for integration test process) and upload them to Amazon ECR (AWS CodeBuild)创建 2 个 docker 图像(用于生产过程和集成测试过程)并将它们上传到 Amazon ECR (AWS CodeBuild)

The problem问题

is that I couldn't found any suitable steps that the pipeline can trigger and and which step will start these containers and runs the integration tests (and of course in case of failure, raise an error on the pipeline too)是我找不到管道可以触发的任何合适的步骤,以及哪个步骤将启动这些容器并运行集成测试(当然,如果失败,也会在管道上引发错误)

My initial我的首字母

idea was to create an ECS Cluster with FARGATE task definition and the pipeline "executes" this task想法是创建一个带有 FARGATE 任务定义的 ECS 集群,管道“执行”这个任务

So please help me how to achieve this goal (by completing my initial thought or proposing a new one)...所以请帮助我如何实现这个目标(通过完成我最初的想法或提出一个新的想法)......

The important is that I want to be sure that if I submit a commit to the branch it will be built, unit tested and integration tested重要的是我想确保如果我向分支提交提交,它将被构建、单元测试和集成测试

Thank you谢谢

AWS CodeBuild can run any script, not just build scripts. AWS CodeBuild 可以运行任何脚本,而不仅仅是构建脚本。 You should add another step to your pipeline that runs another CodeBuild step that runs your integration tests.您应该向管道添加另一个步骤,该步骤运行另一个运行集成测试的 CodeBuild 步骤。

I think you can store your code base to aws code commit and from there just trigger the lambda/ step function for unit testing, integration testing, etc.我认为您可以将代码库存储到 aws code commit,然后从那里触发 lambda/ step function 进行单元测试、集成测试等。

In lemon words all you can do is create dummy container that will run your test cases and you can use the deploy stage to do the deployment over your container or skip the last step.用柠檬的话来说,您所能做的就是创建将运行您的测试用例的虚拟容器,您可以使用部署阶段在您的容器上进行部署或跳过最后一步。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM