Я получаю ошибку ниже даже после того, как все тесты пройдены под VsTest
задачей.
2019-04-04T10:22:14.3913769Z Unable to find d:\a\r1\a\xxx\e2e\bin\Release\netcoreapp2.1\testhost.dll. Please publish your test project and retry.
2019-04-04T10:22:15.1564640Z Results File: d:\a\r1\a\TestResults\VssAdministrator_fv-az153_2019-04-04_10_22_13.trx
2019-04-04T10:22:15.1606430Z
2019-04-04T10:22:15.1607111Z Test Run Aborted.
2019-04-04T10:22:15.1607372Z Total tests: Unknown. Passed: 6. Failed: 0. Skipped: 0.
2019-04-04T10:22:15.1607627Z Test execution time: 36.3008 Seconds
2019-04-04T10:22:15.3788506Z ##[warning]Vstest failed with error. Check logs for failures. There might be failed tests.
2019-04-04T10:22:15.3917110Z ##[error]Error: The process 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe' failed with exit code 1
2019-04-04T10:22:15.8355860Z ##[error]VsTest task failed
Когда я пытался локально с ниже, но без ошибок:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe C:\xxx\src\xxx.EndToEnd.Integration.Tests\bin\Debug\netcoreapp2.1\xxx.EndToEnd.Integration.Tests.dll /logger:trx 2>error.txt
Я тоже пробовал это решение, но не повезло.
build.yaml
- task: CopyFiles@2
displayName: "Copy Files to: $(Build.ArtifactStagingDirectory)"
inputs:
contents: '$(Build.SourcesDirectory)/src/xxx.EndToEnd.Integration.Tests/**'
targetFolder: $(Build.ArtifactStagingDirectory)
- task: DotNetCoreCLI@2
displayName: "dotnet e2e tests"
inputs:
command: publish
publishWebProjects: false
projects: '**/*.csproj'
arguments: --output $(Build.ArtifactStagingDirectory)/src/xxx.EndToEnd.Integration.Tests
zipAfterPublish: false
- task: PublishBuildArtifacts@1
displayName: "Publish End-to-End Tests"
inputs:
artifactName: e2e
PathtoPublish: '$(Build.ArtifactStagingDirectory)/src/xxx.EndToEnd.Integration.Tests'
Я заметил ниже в журналах, которые имеют различие в путях (т. Е. Выпуск конвейера - d:\a\r1\a\EstimationCore\e2e\xxx.EndToEnd.Integration.Tests
и Сборка конвейера - d:\a\1\a\src\xxx.EndToEnd.Integration.Tests\bin\Release\netcoreapp2.1
Полный журнал:
Release pipeline - Download artifact - EstimationCore - e2e
2019-04-07T09:05:10.8843174Z Downloaded e2e/xxx.EndToEnd.Integration.Tests/xxx.EndToEnd.Integration.Tests.deps.json to d:\a\r1\a\EstimationCore\e2e\xxx.EndToEnd.Integration.Tests\xxx.EndToEnd.Integration.Tests.deps.json
Build pipeline - Copy Files to: $(Build.ArtifactStagingDirectory)
Copying d:\a\1\s\src\xxx.EndToEnd.Integration.Tests\bin\Release\netcoreapp2.1\xxx.EndToEnd.Integration.Tests.deps.json to d:\a\1\a\src\xxx.EndToEnd.Integration.Tests\bin\Release\netcoreapp2.1\xxx.EndToEnd.Integration.Tests.deps.json