如何选择在我的掌舵版本上运行哪个测试套件
我想在头盔版本上的不同(部分手动)CI作业中运行不同的测试套件。
I want to run different test suites on my helm release in different (partly manual) CI jobs.
如何最好地从CI作业执行这些测试套件?
How do I best execute these test suites from a CI job?
详细信息:
使用单个测试套件, helm test
非常有帮助。但是我怎么能容易地告诉 helm test
要执行哪个测试套件?
With a single test suite, helm test
is very helpful. But how can I easily tell helm test
which test suite to execute?
目前,我只有两个测试套件 A
和 B
以及环境变量 SUITE
我通过头盔安装注入。测试作业根据 SUITE
的值确定要执行的测试套件。但是这种注入很复杂,我希望有可能依次或同时执行多个测试套件。
Currently, I have only two test suites A
and B
and an environment variable SUITE
I inject via helm install. The test job decides based on the value of SUITE
which test suite to execute. But this injection is complex and I would like to have the possibility to execute multiple test suites sequentially or concurrently.
因此,我创建了两个舵图 A.yaml
和 B.yaml
。我可以用特定的头盔图表以某种方式调用 helm test
,例如 helm test general / A.yaml
(请参阅可以使用Helm测试单独运行套房?)?
Thus I created two helm charts A.yaml
and B.yaml
. Can I somehow call helm test
with a specific helm chart, e.g. helm test general/A.yaml
(see Can Helm test be used to run separate suites?)?
如果没有,最好的方法是什么?在实例0中使用 deployment-A
和 deployment-B
并在实例执行时将部署扩展到1?然后,如何将(失败的)测试执行(和日志输出)传达回CI(在我的情况下为gitlab)?
If not, what is the best approach? Using deployment-A
and deployment-B
with instances 0 and scale a deployment to 1 when we want to execute it? How do I then communicate the (un-)successful test execution (and log output) back to CI (gitlab in my case)?
恐怕Helm当前不支持此功能(请查看此未解决的问题
I'm afraid this is not currently supported in helm (check out this opened issue on github).
相反,您可以做的是创建一个单独的图表文件夹,其中包含其中一项测试,或者签出章鱼。创建它是为了将 helm test
替换为其他功能,其中之一是选择性测试。
What you can do instead is create separate chart folder with one of the tests in it or check out Octopus. It was created to replace helm test
with additional functionalities and one of them is selective testing.