我有一个非常基本的 python 应用程序,我正在测试它以使 CI 正常工作。我有一个 gitlab-ci.yml 文件,其中包含在 Windows gitlab runner 上运行的以下内容。
test:
script:
- conda env create -f environment.yml
- activate scraper-worker
- python -m pytest
它创建的环境没问题,但是一旦环境被激活,它就会打印出来:Job succeeded, and it never runs pytest, it just finishes.
如果我注释掉 activate scraper-worker 行,那么 pytest 将运行,但它显然失败了,因为环境不活跃。知道我这里出了什么问题吗?
仅供引用。我曾尝试在 before_script 中进行环境设置和激活,但还是一样。 Env 已构建并激活,但测试从未运行。
请您参考如下方法:
事实证明,我必须将 Shell = "powershell"添加到我的 gitlab runner 配置中才能使其工作。
