![](/img/trans.png)
[英]Azure DevOps Pipeline does not run Pytest. Keeps loading
[英]Pytest in Azure pipeline does not see specific files?
我有一個src
目錄,其中包含一個pyproject.toml
,就在我的setup.py
旁邊(事實上,我可以找到它)。
但是當我運行任務時
- bash: pytest -c src/pyproject.toml
displayName: Run tests
workingDirectory: $(Pipeline.Workspace)
我得到FileNotFoundError: [Errno 2] No such file or directory: '/home/vsts/work/1/src/pyproject.toml'
。
一切正常,無需嘗試從 pytest 指向此文件。 為什么? 相同的設置在本地運行良好。
workingDirectory
應該是$(System.DefaultWorkingDirectory)
,而不是$(Pipeline.Workspace)
。
$(Pipeline.Workspace)
是代理上創建給定構建管道的所有文件夾的本地路徑。
$(System.DefaultWorkingDirectory)
是下載源代碼文件的代理上的本地路徑。
單擊此文檔以獲取有關 Azure DevOps 中預定義變量的詳細信息
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.