You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

为何Azure Pipelines中发布测试结果的链接返回404?

问题

Azure Pipelines流水线已运行,检测到测试结果并显示已完成上传,但点击返回的测试结果链接时出现404错误。这是首次在流水线中使用PublishTestResults任务,根据微软官方文档,该任务应“直接可用”,请问是否需要配置LogStore等相关设置?

任务输出日志

2020-09-10T13:09:46.0788962Z ##[section]Starting: PublishTestResults 2020-09-10T13:09:46.0796709Z ============================================================================== 
2020-09-10T13:09:46.0797094Z Task : Publish Test Results 
2020-09-10T13:09:46.0797403Z Description : Publish test results to Azure Pipelines 
2020-09-10T13:09:46.0797695Z Version : 2.171.0 
2020-09-10T13:09:46.0797952Z Author : Microsoft Corporation 
2020-09-10T13:09:46.0798351Z Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/test/publish-test-results 
2020-09-10T13:09:46.0798797Z 
============================================================================== 
2020-09-10T13:09:47.0324426Z [command]/usr/bin/dotnet --version 
2020-09-10T13:09:47.0324719Z 3.1.401 
2020-09-10T13:09:47.7287270Z Result Attachments will be stored in LogStore 
2020-09-10T13:09:47.7408902Z Run Attachments will be stored in LogStore 
2020-09-10T13:09:47.9409482Z ##[section]Async Command Start: Publish test results 
2020-09-10T13:09:48.0169350Z Publishing test results to test run '20'. 
2020-09-10T13:09:48.0201815Z 
TestResults To Publish 7, Test run id:20 
2020-09-10T13:09:48.0246833Z 
Test results publishing 7, remaining: 0. Test run id: 
20 2020-09-10T13:09:48.6828668Z 
**Published Test Run : https://dev.azure.com/tmc-it/tmconsulting-us-com/_TestManagement/Runs?runId=20&_a=runCharts. 
2020-09-10T13:09:49.1592828Z **
TestRunPublisher.IsTestRunFailed: Getting test run summary with run id: 20 using stats api 
2020-09-10T13:09:49.1925388Z 
TestRunPublisher.IsTestRunFailed: checking if test run is failed using run summary input 
2020-09-10T13:09:49.1926158Z Number of failed tests which are non-flaky is: 1 
2020-09-10T13:09:49.1966815Z 
Failed Results are published 
2020-09-10T13:09:49.2098192Z ##[section]Async Command End: Publish test results 
2020-09-10T13:09:49.2099790Z ##[section]Finishing: PublishTestResults

排查与解决方案

  • 修复链接转义字符:日志中的链接包含HTML转义字符&,需替换为&,正确访问链接应为:https://dev.azure.com/tmc-it/tmconsulting-us-com/_TestManagement/Runs?runId=20&_a=runCharts
  • 验证账号权限:确认当前登录账号拥有该项目的测试运行查看权限,权限不足会导致404
  • 检查任务配置:无需额外配置LogStore,PublishTestResults任务默认处理存储。但需确认testResultsFiles参数是否正确指向测试结果文件(如.trx、.xml格式),路径错误会导致实际未上传有效结果
  • 等待同步延迟:测试结果上传后可能存在短暂的系统同步延迟,等待1-2分钟后再尝试访问
  • 升级任务版本:当前使用的任务版本为2.171.0,可尝试升级至最新版本,旧版本可能存在链接生成的已知bug

内容的提问来源于stack exchange,提问作者Wani Mudasir

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.07 18:13:17