将测试添加到GitLab管道
我已经将文件(测试文件,pytest)推到了我的gitlab项目中,我想在GitLab项目的CI/CD中显示测试。
谁能告诉我我该怎么做?我尝试在.gitlab-ci.yml文件上添加测试,但是我不确定它的正确语法是什么。
我试图添加的内容:
testing_testing:
stage: test
script: test_sample.py
有什么想法吗?
I have pushed a file (test file, pytest) to my Gitlab project, I want to show tests run in a pipeline in CI/CD of the Gitlab project.
Can anyone tell me how can I do this? I tried to add a test at the .gitlab-ci.yml file, but I’m not sure what’s the right syntax of it.
What I tried to add :
testing_testing:
stage: test
script: test_sample.py
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有GitLab官方示例: lib/gitlab/ci/templates/python.gitlab-ci.yml·gitlab
在您的情况下,在CI中添加Python测试,您应该在运行Python脚本中添加图像。前任:
There is GitLab official example: lib/gitlab/ci/templates/Python.gitlab-ci.yml · GitLab
In your case, add a python test in CI, you should add an image to run your python script. ex: