我在RELEASE任務期間收到以下錯誤與「運行功能測試」任務。運行功能測試 - 無法獲得團隊基礎集合Uri
我試圖使用.NET編寫4.6.1 C#內建的VS .NET測試框架運行單元測試的DLL(VS2015.Update2)
的原因在虛擬機上運行測試是場景不上 託管測試劑
方案
Azure的VM 單元測試dll的工作
個發佈任務
Visual Studio的測試代理部署(成功)
Azure的文件複製(更迭)
運行功能測試(失敗)
LOG
> 2016-04-14T01:42:49.2222367Z Executing the powershell script:
> C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agents\1.97.1\tasks\RunVisualStudioTestsusingTestAgent\1.0.32\RunDistributedTests.ps1
> 2016-04-14T01:42:50.5719493Z ##[debug]Entering script
> RunDistributedTests.ps1 2016-04-14T01:42:50.5749473Z
> ##[debug]TestMachineGroup = xxxx.australiaeast.cloudapp.azure.com
> 2016-04-14T01:42:50.5759489Z ##[debug]Test Drop Location =
> C:\AcceptanceTests\SampleWebApiE2ERelease 2016-04-14T01:42:50.5759489Z
> ##[debug]Source Filter = bin\Release\AcceptanceTest.dll 2016-04-14T01:42:50.5769483Z ##[debug]Test Filter Criteria =
> 2016-04-14T01:42:50.5779473Z ##[debug]RunSettings File =
> C:\a\2c16ad4c2\CI Build\drop\AcceptanceTest\AcceptanceTest.runsettings
> 2016-04-14T01:42:50.5779473Z ##[debug]Build Platform =
> 2016-04-14T01:42:50.5789483Z ##[debug]Build Configuration =
> 2016-04-14T01:42:50.5789483Z ##[debug]CodeCoverage Enabled = false
> 2016-04-14T01:42:50.5799482Z ##[debug]TestRun Parameters to override =
> 2016-04-14T01:42:50.5799482Z ##[debug]TestConfiguration =
> 2016-04-14T01:42:50.5829484Z ##[debug]Application Under Test Machine
> Group = 2016-04-14T01:42:50.6079488Z ##[debug]Loading module from
> path
> 'C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agents\1.97.1\agent\worker\Modules\Microsoft.TeamFoundation.DistributedTask.Task.Common\Microsoft.TeamFoundation.DistributedTask.Task.Common.dll'.
> 2016-04-14T01:42:50.6479489Z ##[debug]Importing cmdlet
> 'Complete-Task'. 2016-04-14T01:42:50.6489487Z ##[debug]Importing
> cmdlet 'Get-LocalizedString'. 2016-04-14T01:42:50.6499484Z
> ##[debug]Importing cmdlet 'Set-TaskVariable'. 2016-04-14T01:42:50.6499484Z ##[debug]Importing cmdlet
> 'Set-TaskProgress'. 2016-04-14T01:42:50.6509481Z ##[debug]Importing
> cmdlet 'Add-TaskIssue'. 2016-04-14T01:42:50.6509481Z
> ##[debug]Importing cmdlet 'Write-TaskDetail'. 2016-04-14T01:42:50.6519486Z ##[debug]Importing cmdlet 'Find-Files'.
> 2016-04-14T01:42:50.6719494Z ##[debug]Loading module from path
> 'C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agents\1.97.1\agent\worker\Modules\Microsoft.TeamFoundation.DistributedTask.Task.Internal\Microsoft.TeamFoundation.DistributedTask.Task.Internal.dll'.
> 2016-04-14T01:42:51.1184496Z ##[debug]Importing cmdlet
> 'Add-BuildAttachment'. 2016-04-14T01:42:51.1194518Z ##[debug]Importing
> cmdlet 'Convert-String'. 2016-04-14T01:42:51.1204518Z
> ##[debug]Importing cmdlet 'Get-IndexedSourceFilePaths'. 2016-04-14T01:42:51.1204518Z ##[debug]Importing cmdlet
> 'Get-JavaDevelopmentKitPath'. 2016-04-14T01:42:51.1214490Z
> ##[debug]Importing cmdlet 'Get-MSBuildLocation'. 2016-04-14T01:42:51.1214490Z ##[debug]Importing cmdlet
> 'Get-ServiceEndpoint'. 2016-04-14T01:42:51.1224478Z ##[debug]Importing
> cmdlet 'Get-TfsClientCredentials'. 2016-04-14T01:42:51.1224478Z
> ##[debug]Importing cmdlet 'Get-ToolPath'. 2016-04-14T01:42:51.1234489Z ##[debug]Importing cmdlet 'Get-TaskVariable'. 2016-04-14T01:42:51.1234489Z ##[debug]Importing cmdlet
> 'Get-VisualStudioPath'. 2016-04-14T01:42:51.1244823Z
> ##[debug]Importing cmdlet 'Get-VssConnection'. 2016-04-14T01:42:51.1244823Z ##[debug]Importing cmdlet 'Invoke-Ant'.
> 2016-04-14T01:42:51.1255789Z ##[debug]Importing cmdlet
> 'Invoke-BatchScript'. 2016-04-14T01:42:51.1255789Z ##[debug]Importing
> cmdlet 'Invoke-Maven'. 2016-04-14T01:42:51.1266037Z ##[debug]Importing
> cmdlet 'Invoke-MSBuild'. 2016-04-14T01:42:51.1266037Z
> ##[debug]Importing cmdlet 'Invoke-PublishSymbols'. 2016-04-14T01:42:51.1276045Z ##[debug]Importing cmdlet 'Invoke-Tool'.
> 2016-04-14T01:42:51.1276045Z ##[debug]Importing cmdlet
> 'Invoke-VSTest'. 2016-04-14T01:42:51.1286046Z ##[debug]Importing
> cmdlet 'Publish-BuildArtifact'. 2016-04-14T01:42:51.1286046Z
> ##[debug]Importing cmdlet 'Copy-BuildArtifact'. 2016-04-14T01:42:51.1296014Z ##[debug]Importing cmdlet
> 'Add-BuildArtifactLink'. 2016-04-14T01:42:51.1296014Z
> ##[debug]Importing cmdlet 'Register-XamarinLicense'. 2016-04-14T01:42:51.1306047Z ##[debug]Importing cmdlet
> 'Unregister-XamarinLicense'. 2016-04-14T01:42:51.1306047Z
> ##[debug]Importing cmdlet 'Get-X509Certificate'. 2016-04-14T01:42:51.3085527Z ##[debug]Loading module from path
> 'C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agents\1.97.1\agent\worker\Modules\Microsoft.TeamFoundation.DistributedTask.Task.DTA\Microsoft.TeamFoundation.DistributedTask.Task.DTA.dll'.
> 2016-04-14T01:42:51.4288417Z ##[debug]Importing cmdlet
> 'Invoke-DeployTestAgent'. 2016-04-14T01:42:51.4298713Z
> ##[debug]Importing cmdlet 'Invoke-RunDistributedTests'. 2016-04-14T01:42:51.4318712Z ##[debug]Getting the connection object
> 2016-04-14T01:42:51.6626731Z ##[debug]UnregisterTestAgent script Path
> = 2016-04-14T01:42:51.6626731Z ##[debug]Calling Invoke-RunDistributedTests 2016-04-14T01:42:51.7435357Z
> ##[debug]Invoking Run Distributed Tests with Register Environment support 2016-04-14T01:42:52.5708848Z ##[warning]For troubleshooting,
> refer http://aka.ms/remotevstest. 2016-04-14T01:42:52.6509473Z
> ##[error]System.InvalidOperationException: Unable to get teamfoundation Collection Uri. Contact your administrator for more
> information. 2016-04-14T01:42:52.6519461Z ##[error] at
> Microsoft.TeamFoundation.DistributedTask.Task.DistributedTestAutomation.RunTests.Run()
> 2016-04-14T01:42:52.6529465Z ##[error] at
> Microsoft.TeamFoundation.DistributedTask.Task.DistributedTestAutomation.TaskRunner.Run(Dictionary`2
> arguments, VssConnection connection, TaskType taskType)
> 2016-04-14T01:42:52.6529465Z ##[error] at
> Microsoft.TeamFoundation.DistributedTask.Task.DistributedTestAutomation.RundistributedTestsCmdLet.ProcessRecord()
UPDATE - 新增屏幕截圖
UPDATE 2 - 更詳細
Azure的VM是不是一個域,其在工作組
UPDATE 3 - 重新創建爲一個BUILD任務
我用一個任務「運行功能測試」創建了一個新的BUILD。 發生了類似的錯誤。
構建完整的LOG
2016-04-19T21:51:19.2143997Z Entering OnPrepareEnvironment
2016-04-19T21:51:19.2613857Z Primary repository: SampleWebApiE2ERelease
2016-04-19T21:51:19.2643916Z Calculating build folder hash key.
2016-04-19T21:51:19.2683854Z Loading tracking config if exists: C:\a\SourceRootMapping\0898c6c5-1b24-4adf-945a-6859faaaf010\8\SourceFolder.json
2016-04-19T21:51:19.2703915Z Creating new tracking config.
2016-04-19T21:51:19.2719613Z Loading top-level tracking config if exists: C:\a\SourceRootMapping\Mappings.json
2016-04-19T21:51:19.2752569Z Writing config to file: C:\a\SourceRootMapping\Mappings.json
2016-04-19T21:51:19.3362720Z Writing config to file: C:\a\SourceRootMapping\0898c6c5-1b24-4adf-945a-6859faaaf010\8\SourceFolder.json
2016-04-19T21:51:19.3452728Z Checking if artifacts directory exists: C:\a\1\a
2016-04-19T21:51:19.3452728Z Creating artifacts directory.
2016-04-19T21:51:19.3462731Z Checking if test results directory exists: C:\a\1\TestResults
2016-04-19T21:51:19.3472726Z Creating test results directory.
2016-04-19T21:51:19.3482737Z Creating binaries directory.
2016-04-19T21:51:19.3482737Z Setting local variables.
2016-04-19T21:51:19.3492744Z Create the initial timeline records for the tasks
2016-04-19T21:51:19.3512737Z Preparing repositories
2016-04-19T21:51:19.3522741Z repo clean = False
2016-04-19T21:51:19.3522741Z Found 2 endpoints to consider
2016-04-19T21:51:19.3692726Z Found 1 repositories to sync
2016-04-19T21:51:19.3822789Z Starting: Get sources
2016-04-19T21:51:19.3872730Z build.fetchtags=false
2016-04-19T21:51:19.3922753Z Entering GitSourceProvider.PrepareRepositoryAsync
2016-04-19T21:51:19.3932745Z Repository type=TfsGit
2016-04-19T21:51:19.3932745Z localPath=C:\a\1\s
2016-04-19T21:51:19.3942746Z clean=False
2016-04-19T21:51:19.3942746Z sourceBranch=refs/heads/master
2016-04-19T21:51:19.3952739Z sourceVersion=60e5e7f72e94016da7c2de37c839a015656f803c
2016-04-19T21:51:19.3952739Z Syncing repository: SampleWebApiE2ERelease (Git)
2016-04-19T21:51:19.3962739Z repository url=https://*******.visualstudio.com/DefaultCollection/_git/SampleWebApiE2ERelease
2016-04-19T21:51:19.3982738Z checkoutSubmodules=False
2016-04-19T21:51:19.6062900Z Starting clone
2016-04-19T21:51:21.3684519Z Checking out 60e5e7f72e94016da7c2de37c839a015656f803c to C:\a\1\s
2016-04-19T21:51:21.5500305Z Checked out branch refs/heads/master for repository SampleWebApiE2ERelease at commit 60e5e7f72e94016da7c2de37c839a015656f803c
2016-04-19T21:51:21.5510565Z Leaving GitSourceProvider.PrepareRepositoryAsync
2016-04-19T21:51:21.5720503Z Leaving OnPrepareEnvironment
2016-04-19T21:51:21.7216514Z Running tasks
2016-04-19T21:51:21.7586505Z Starting task: Run Tests bin\Release\AcceptanceTest.dll on *************************.australiaeast.cloudapp.azure.com
2016-04-19T21:51:21.9697226Z Executing the powershell script: C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agents\1.98.1\tasks\RunVisualStudioTestsusingTestAgent\1.0.33\RunDistributedTests.ps1
2016-04-19T21:51:22.3211330Z ##[debug]Entering script RunDistributedTests.ps1
2016-04-19T21:51:22.3241378Z ##[debug]TestMachineGroup = *************************.australiaeast.cloudapp.azure.com
2016-04-19T21:51:22.3251318Z ##[debug]Test Drop Location = C:\AcceptanceTests\SampleWebApiE2ERelease
2016-04-19T21:51:22.3251318Z ##[debug]Source Filter = bin\Release\AcceptanceTest.dll
2016-04-19T21:51:22.3261325Z ##[debug]Test Filter Criteria =
2016-04-19T21:51:22.3271314Z ##[debug]RunSettings File = C:\AcceptanceTests\SampleWebApiE2ERelease\AcceptanceTest.runsettings
2016-04-19T21:51:22.3271314Z ##[debug]Build Platform =
2016-04-19T21:51:22.3281422Z ##[debug]Build Configuration =
2016-04-19T21:51:22.3291320Z ##[debug]CodeCoverage Enabled = false
2016-04-19T21:51:22.3291320Z ##[debug]TestRun Parameters to override =
2016-04-19T21:51:22.3301320Z ##[debug]TestConfiguration =
2016-04-19T21:51:22.3321302Z ##[debug]Application Under Test Machine Group =
2016-04-19T21:51:22.3531325Z ##[debug]Loading module from path 'C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agents\1.98.1\agent\worker\Modules\Microsoft.TeamFoundation.DistributedTask.Task.Common\Microsoft.TeamFoundation.DistributedTask.Task.Common.dll'.
2016-04-19T21:51:22.3681296Z ##[debug]Importing cmdlet 'Complete-Task'.
2016-04-19T21:51:22.3681296Z ##[debug]Importing cmdlet 'Get-LocalizedString'.
2016-04-19T21:51:22.3691292Z ##[debug]Importing cmdlet 'Set-TaskVariable'.
2016-04-19T21:51:22.3691292Z ##[debug]Importing cmdlet 'Set-TaskProgress'.
2016-04-19T21:51:22.3691292Z ##[debug]Importing cmdlet 'Add-TaskIssue'.
2016-04-19T21:51:22.3701295Z ##[debug]Importing cmdlet 'Write-TaskDetail'.
2016-04-19T21:51:22.3701295Z ##[debug]Importing cmdlet 'Find-Files'.
2016-04-19T21:51:22.3841314Z ##[debug]Loading module from path 'C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agents\1.98.1\agent\worker\Modules\Microsoft.TeamFoundation.DistributedTask.Task.Internal\Microsoft.TeamFoundation.DistributedTask.Task.Internal.dll'.
2016-04-19T21:51:22.3901295Z ##[debug]Importing cmdlet 'Add-BuildAttachment'.
2016-04-19T21:51:22.3901295Z ##[debug]Importing cmdlet 'Convert-String'.
2016-04-19T21:51:22.3911318Z ##[debug]Importing cmdlet 'Get-IndexedSourceFilePaths'.
2016-04-19T21:51:22.3911318Z ##[debug]Importing cmdlet 'Get-JavaDevelopmentKitPath'.
2016-04-19T21:51:22.3921318Z ##[debug]Importing cmdlet 'Get-MSBuildLocation'.
2016-04-19T21:51:22.3921318Z ##[debug]Importing cmdlet 'Get-ServiceEndpoint'.
2016-04-19T21:51:22.3931319Z ##[debug]Importing cmdlet 'Get-TfsClientCredentials'.
2016-04-19T21:51:22.3941311Z ##[debug]Importing cmdlet 'Get-ToolPath'.
2016-04-19T21:51:22.3941311Z ##[debug]Importing cmdlet 'Get-TaskVariable'.
2016-04-19T21:51:22.3951312Z ##[debug]Importing cmdlet 'Get-VisualStudioPath'.
2016-04-19T21:51:22.3951312Z ##[debug]Importing cmdlet 'Get-VssConnection'.
2016-04-19T21:51:22.3961310Z ##[debug]Importing cmdlet 'Invoke-Ant'.
2016-04-19T21:51:22.3961310Z ##[debug]Importing cmdlet 'Invoke-BatchScript'.
2016-04-19T21:51:22.3971305Z ##[debug]Importing cmdlet 'Invoke-Maven'.
2016-04-19T21:51:22.3971305Z ##[debug]Importing cmdlet 'Invoke-MSBuild'.
2016-04-19T21:51:22.3981310Z ##[debug]Importing cmdlet 'Invoke-PublishSymbols'.
2016-04-19T21:51:22.3981310Z ##[debug]Importing cmdlet 'Invoke-Tool'.
2016-04-19T21:51:22.3991312Z ##[debug]Importing cmdlet 'Invoke-VSTest'.
2016-04-19T21:51:22.3991312Z ##[debug]Importing cmdlet 'Publish-BuildArtifact'.
2016-04-19T21:51:22.4001333Z ##[debug]Importing cmdlet 'Copy-BuildArtifact'.
2016-04-19T21:51:22.4001333Z ##[debug]Importing cmdlet 'Add-BuildArtifactLink'.
2016-04-19T21:51:22.4011309Z ##[debug]Importing cmdlet 'Register-XamarinLicense'.
2016-04-19T21:51:22.4011309Z ##[debug]Importing cmdlet 'Unregister-XamarinLicense'.
2016-04-19T21:51:22.4011309Z ##[debug]Importing cmdlet 'Get-X509Certificate'.
2016-04-19T21:51:22.4141314Z ##[debug]Loading module from path 'C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agents\1.98.1\agent\worker\Modules\Microsoft.TeamFoundation.DistributedTask.Task.DTA\Microsoft.TeamFoundation.DistributedTask.Task.DTA.dll'.
2016-04-19T21:51:22.4351328Z ##[debug]Importing cmdlet 'Invoke-DeployTestAgent'.
2016-04-19T21:51:22.4361318Z ##[debug]Importing cmdlet 'Invoke-RunDistributedTests'.
2016-04-19T21:51:22.4381326Z ##[debug]Getting the connection object
2016-04-19T21:51:23.2196120Z ##[debug]UnregisterTestAgent script Path =
2016-04-19T21:51:23.2206119Z ##[debug]Calling Invoke-RunDistributedTests
2016-04-19T21:51:23.3495532Z ##[debug]Invoking Run Distributed Tests with Register Environment support
2016-04-19T21:51:23.5023828Z ##[warning]For troubleshooting, refer http://aka.ms/remotevstest.
2016-04-19T21:51:23.5171330Z ##[error]System.InvalidOperationException: Unable to get teamfoundation Collection Uri. Contact your administrator for more information.
2016-04-19T21:51:23.5181352Z ##[error] at Microsoft.TeamFoundation.DistributedTask.Task.DistributedTestAutomation.RunTests.Run()
2016-04-19T21:51:23.5191312Z ##[error] at Microsoft.TeamFoundation.DistributedTask.Task.DistributedTestAutomation.TaskRunner.Run(Dictionary`2 arguments, VssConnection connection, TaskType taskType)
2016-04-19T21:51:23.5201289Z ##[error] at Microsoft.TeamFoundation.DistributedTask.Task.DistributedTestAutomation.RundistributedTestsCmdLet.ProcessRecord()
2016-04-19T21:51:23.5669478Z Finishing task: RunVisualStudioTestsusingTestAgent
2016-04-19T21:51:23.5679492Z ##[error]System.Exception: Task RunVisualStudioTestsusingTestAgent failed. This caused the job to fail. Look at the logs for the task for more details.
2016-04-19T21:51:23.5689495Z ##[error] at Microsoft.TeamFoundation.DistributedTask.Worker.JobRunner.Run(IJobContext jobContext, IJobRequest job, IJobExtension jobExtension, CancellationTokenSource tokenSource)
2016-04-19T21:51:23.5719485Z Entering OnFinalizeJob
2016-04-19T21:51:23.5739469Z Leaving OnFinalizeJob
UPDATE 4
我改變了任務的BUILD使得任務;
NuGet Installer
Visual Studio Build
Visual Studio Test (unit tests)
Index Sources & Publish Symbols
Copy And Publish Build Artifacts
Azure File Copy
Visual Studio Test Agent Deployment
Run Functional Tests
「運行功能測試」工作。
然後,我從BUILD中刪除了3個任務Azure文件複製,Visual Studio測試代理部署,運行功能測試,因爲我不想將驗收測試作爲BUILD的一部分,但作爲RELEASE的一部分。
然後我改變了我的RELEASE任務,
Azure File Copy
Visual Studio Test Agent Deployment
Run Functional Tests
工作。
然後我禁用了任務Visual Studio測試代理部署,因爲代理現在部署在虛擬機上,並且該任務需要一段時間才能運行。
失敗了,似乎Run Functional Tasks需要Visual Studio Test Agent Deployment的前面的任務。
這是運行功能測試的錯誤嗎?您是否應該能夠使用已安裝的測試代理配置您自己的虛擬機?
你能共享運行功能測試任務設置的屏幕截圖? –
還有一個問題,如果您在BUILD選項卡下運行任務,您是否也會看到這個錯誤? –
您在「Visual Studio測試代理部署」和「運行功能測試」任務中指定的機器是否相同?您可以先嚐試運行「Azure File Copy」任務,然後運行「Visual Studio Test Agent部署」和「運行功能測試」任務?對於Update 3,運行功能測試需要在「Visual Studio Test Agent Deployment」任務之前進行,您可能需要在「Run Functional Test」任務前添加「Visual Studio Test Agent Deployment」任務,然後重試。 –