在Windows上实现在.gitlab-ci.yml中运行pytest的示例程序时遇到问题:
使用Shell执行器…
请在下面找到。gitlab-ci.yml:
# .gitlab-ci.yml
test_sample:
stage: test
tags:
- test_sam
script:
- echo "Testing"
- pytest -s Target\tests
when: manual
CI/CD终端输出:
pytest is not recognized as the name of a cmdlet, function, script file, or operable program.
Python和pytest已经安装在运行测试的Windows操作系统上,但测试仍然失败。 我已尝试了以下线程中建议的解决方案,但不起作用: gitlab-ci.yml: 'script: -pytest cannot find any tests to check'
你能建议如何在windows上通过此测试吗
以下命令工作正常,没有任何问题:
如果
python
被识别,您可以将pytest
替换为with this similar project,替换为:(该initial switch to ^{} 失败)
如果要使用pytest,则需要在
.gitlab.yml
中使用python Docker映像见Patrick Kennedy中的“Setting Up GitLab CI for a Python Application”
相关问题 更多 >
编程相关推荐