我需要發布結果,但無法并且已經瀏覽了該站點并進行了研究,但仍然無法發布測驗結果。我是否需要編輯某些類似于 cypress.json 的檔案才能解決發布問題。單元測驗和覆寫都沒有發布任何結果,也沒有找到檔案。代碼和錯誤結果在下面突出顯示。
代碼 :
trigger:
branches:
include:
- #infra-ML-unit-test
variables:
- group: aws_details #just for backup roles approach
- group: snowflake-variables
- group: unit-test-dev
jobs:
- job: 'Unit_Test'
pool:
vmImage: 'windows-latest' # other options: 'macOS-latest', 'windows-latest', 'ubuntu-latest'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.8'
displayName: 'Use Python 3.x'
- task: UsePythonVersion@0
inputs:
versionSpec: '3.8'
- script: |
pip install virtualenv
virtualenv venv
source venv/bin/activate
pip install -r requirements.txt
python -m pip install --upgrade pip setuptools sqlalchemy snowflake.sqlalchemy
echo "$(System.DefaultWorkingDirectory)"
echo "$(Build.StagingDirectory)"
pip show pandas
python -m pytest --log-file $SYSTEM_ARTIFACTSDIRECTORY/smoke-qa.log --junitxml=TEST-qa-smoke.xml -rP --excelreport=report.xls --html=pytest_report.html --self-contained-html
#displayName: 'Install python tools'
- job: publish_result
dependsOn: Unit_Test
condition: succeededOrFailed()
steps:
- task: PublishTestResults@2
displayName: 'Publish test result /010.xml'
inputs:
testResultsFormat: 'JUnit' # Options: JUnit, NUnit, VSTest, xUnit, cTest
testResultsFiles: '**/TEST-*.xml'
testRunTitle: 010
mergeTestResults: true
pytest結果

單元測驗和覆寫

是否有任何檔案可以在存盤庫中找到以更新和鏈接發布覆寫和測驗結果,因為提到了錯誤或警告:
**
##[警告]沒有找到匹配 /TEST-*.xml 的測驗結果檔案。
**
uj5u.com熱心網友回復:
你有兩個選擇:
- 在運行測驗之前安裝pytest-azurepipelines包:
pip install pytest pytest-azurepipelines
使
PublishTestResults@2任務從以下位置開始搜索$(Pipeline.Workspace):- task: PublishTestResults@2 displayName: 'Publish test result /010.xml' inputs: testResultsFormat: 'JUnit' testResultsFiles: '$(Pipeline.Workspace)/junit/test-*.xml'
有關更多資訊,請參閱Python:運行測驗
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/447693.html
標籤:Python 单元测试 天蓝色的devops 天蓝色管道 pytest
上一篇:為什么在使用Robolectric的Android單元測驗中呼叫HtmlCompat時會發生ExceptionInInitializerError?
