集成测试使用“安全测试"对部署的服务进行测试.

编程入门 行业动态 更新时间:2024-10-27 08:35:14
本文介绍了集成测试使用“安全测试"对部署的服务进行测试.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在使用掌舵图将多个REST服务部署到Microsoft Azure. 这些服务中的一些彼此通信,并与某些数据库通信.部署后,我想测试一切"是否按预期工作.更确切地说,我想向其中一项服务发送一些HTTP请求,并检查响应是否有意义.当然是在自动化测试中.

I'm using helm charts to deploy several REST services to Microsoft Azure. Some of these services communicate with each other and to some databases. After the deployment I want to test if "everything" works as expected. To be more precise, I want to send some HTTP requests to one of the services and check if the response makes sense. In automated tests of course.

我看到可以在部署后使用头盔测试" ,但这并不是我真正需要的.

I saw that it's possible to run basic commands after the deployment using "helm test", but this is not exactly what I need.

在较早的方法中,我使用 Newman 执行 Postman 集合. Postman集合定义了几个请求以及相应的测试.

In some earlier approach I used Newman to execute a Postman collection in a script after the deployment. The Postman collection defined several requests and the corresponding tests.

现在我不知道如何在新环境(Azure)和部署管道(helm,k8s)中做到这一点.

Now I don't know how to do it in the new environment (Azure) and deployment pipeline (helm, k8s).

再次拥有这样的东西会很好. 但是对我来说,如何做到这一点还不清楚,例如

It would be nice to have something like this again. But for me it's not clear how to do it, e.g.

  • 如何在"helm test"范围内使用Newman?
  • 我如何才能确保开始测试之前已部署的Pod全部正在运行"(需要等待时间?状态检查?)?

newman run "test.postman_collection.json" -e "azure.postman_environment.json" --bail

推荐答案

Helm测试非常灵活,因为它可以运行任何Kubernetes YAML(包括任何Docker映像).例如,您可以检查 MySQL Helm Chart测试.

Helm test is very flexible, because it runs any Kubernetes YAML including any Docker image. As an example, you can check tests for the MySQL Helm Chart.

所以,请问您的问题:

  • 要使用Newman,只需找到安装了Newman的Docker映像(例如,官方的邮递员/新人或自行创建).要使用JSON配置文件,您可以将它们作为ConfigMap放置,也可以将它们复制到容器中.检查他的MySQL Helm Chart以获得更多详细信息.

  • To use Newman, you just need to find a Docker image with the Newman installed (e.g. the official one postman/newman or build your own). To use your JSON configuration files, you can either put them as ConfigMap or copy them into the container. Check he MySQL Helm Chart for more details.

    您说对了,您需要等到系统就绪后再运行测试. AFAIK对此不包括在Helm Test中.因此,您需要将sleep放入脚本中,或者主动使用kubectl进行检查,直到POD准备就绪.

    You're right that you need to wait until your system is ready before running the tests. AFAIK this is not covered by Helm Test. So you need to either put sleep into your script or actively check with kubectl until the PODs are ready.

  • 更多推荐

    集成测试使用“安全测试"对部署的服务进行测试.

    本文发布于:2023-07-29 11:10:21,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1240177.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:测试   进行测试   quot

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!