Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can actually get the test id - its what is printed out as a result of tcm.exe run /create command in powershell it would be something like this:</p> <pre><code>$testRunSubmitResult = .$tcmPath run /create ...... $testID = $testRunSubmitResult -match "[0-9]{1,1000}" (i excluded the error handling logic which needs to be present in order to verify that the run was submitted) after that you can do the following thing - you can export the test run with the used id, and if the test didnt finish yet, you will get and error. do { Start-Sleep -s 60 $testResults = .$tcmPath run /export /id:$testID /resultsfile:$args /collection .... if(Test-Path $args[0]) { break } if($testResults.GetType() -eq @("1").GetType()) { if($testResults[1].Contains("Completed export")) { break } } if ($testResults.Contains("Completed export")) { break } } while ($True) </code></pre> <p>This is not perfect as it might fail in test runs with big attachments (such as ones produced by the Video data collector) but it might be a solution for some of you</p> <p>Or alternatively from powerscript you can just use the TFS API like this:</p> <pre><code>Add-Type -AssemblyName "Microsoft.TeamFoundation.Client, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "Microsoft.TeamFoundation.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "Microsoft.TeamFoundation.TestManagement.Client, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" $tfs = [Microsoft.TeamFoundation.Client.TfsTeamProjectCollectionFactory]::GetTeamProjectCollection("http://tfs:8080/tfs/Collection") $tfs.EnsureAuthenticated() $testManagementService = $tfs.GetService([Microsoft.TeamFoundation.TestManagement.Client.ITestManagementService]) $testManagementTeamProject = $testManagementService.GetTeamProject('Project'); do { Start-Sleep -s 60 $testRun = $testManagementTeamProject.TestRuns.Find($testId); if($testRun.State -eq 'Completed') { break } if($testRun.State -eq 'NeedsInvestigation') { break } if($testRun.State -eq 'Aborted') { break } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload