none
Executing VSTest.Console.exe test via Powershell Invoke-Command RRS feed

  • Question

  • Hi all, cross posted this from SO.

    So I'm trying to kick off test runs via VSTest.Console.exe using Powershell's Invoke-Command. I'm pretty new to powershell, but the script looks like this:
    #Script block to execute on the remote machine
    $scriptBlock = {
    param($shareName, $testRunId, $myTestContainers, $testCategory)
    $localFolder = "c:\$shareName\" + $testRunId
    $exePath = "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe"
    
    $argList = @()
    #Add the containers
    $myTestContainers.Split(",") | foreach {
        $argList += "`"$localFolder\$_`" "
    }
    
    $argList += "/logger:trx"
    $argList += "/settings:$localFolder\remote.testsettings"
    $argList += "/Platform:x64"
    $argList += "/Framework:Framework45"
    
    #Let everyone know whats happening
    Write-Output "Args: $argList"
    
    #Do it
    & $exePath $argList
    }
    
    #Invoke the script block
    Invoke-Command -ScriptBlock $scriptBlock -Credential $credentials -ComputerName 10.123.123.12 -ArgumentList testruns, "1.2.3456", "CaiConTest.dll,CsiConTest.dll", ""
    
    After 60 seconds this is returned:

    Error: Failed to initialize client proxy: could not connect to test process .
    + CategoryInfo          : NotSpecified: (Error: Failed t... test process .:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
    + PSComputerName        : 10.123.123.12

    Error: Failed to initialize client proxy: could not connect to test process .
    + CategoryInfo          : NotSpecified: (Error: Failed t... test process .:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
    + PSComputerName        : 10.123.123.12
    
    Error: There was no endpoint listening at net.pipe://mymachineFQDN/TestExecutor/5208 that could accept the message. This is often caused by an incorrect address or SOAP action. See 
    InnerException, if present, for more details.
    


    I've noticed that if I remove the "-Credential $credentials" and run it on the same machine I'm invoking the command on, it runs and we get test results back just fine. What might I be missing here?


    Thursday, April 21, 2016 11:33 PM

Answers

All replies

  • Hi BenPowerProfessional,

    Your issue is about PowerShell, I help you move to the script forum for dedicated help.

    Thank you for your understanding.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, April 22, 2016 6:47 AM
  • The error is telling you that you have network problems.

    "Error: Failed to initialize client proxy: could not connect to test process "

    Fix your network connectivity.  Perhaps a firewall issue?

    Post in the forum for VSTest.  They will help you understand how to remote this.  The commands you are creating do not make much sense.  Try just typing a command at the prompt to see what errors you get.

    It appears that you are running these commands on the local server so why use Invoke-Command?


    \_(ツ)_/

    Friday, April 22, 2016 10:08 AM
  • I solved this one, thanks. It was related to our VMs which weren't part of the same domain as the controller/agent VMs.
    Tuesday, April 26, 2016 4:43 AM
  • I solved this one, thanks. It was related to our VMs which weren't part of the same domain as the controller/agent VMs.

    That would be a fundamental network problem. A domain is a network.  If endpoints are protected then you must authenticate to access anything.

    The error, however, can be a bit misleading.


    \_(ツ)_/

    Tuesday, April 26, 2016 4:40 PM