Can you change your script for this and try again?
$nunitpath = "C:\AutomatedTests"
If(Test-path $nunitpath){
cd $nunitpath
nunit-console SiteCore.nunit /include:BulkyWasteTests
}
else{
throw "Path [$nunitpath] not found on $($env:computername)"
}
The script I gave you seems to confirm the fact that c:\AutomatedTests doesn’t exist on the machine MYEACCTESTV01, which is the same message you were getting with the initial script.
Are you creating that folder on MYEACCTESTV01 during the deployment, or was it manually created beforehand?
Are you deploying content to c:\AutomatedTests during the deployment, which you plan to use in that script that is failing?
Hi Dalmiro
Thank you for your reply. It was a colleague who manually set up this location for me. This where the bin folder from the Visual Studio solution containing the NUnite files and tests has been copied. This location and folder already exists and is not being created as part of the deployment process.
Perhaps it is a permissions problem? I will ask my colleague to investigate.
Regards,
Michael
Hi Dalmiro
We have now created a new location and the location error is no longer generated so we can rule that out, however, there is now another error:
The term ‘nunit-console’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Octopus\Work\20170118115419-31\Script.ps1:5 char:52
To test the powershell script syntax, I copied it from the process step and created a ps1 file. I am able to run this file manually and it successfully initiates the nunit-console so I assume the syntax in the process step is correct.
I also tried adding set-executionpolicy Unrestricted; but it did not make any difference.
Thanks again,
Michael
Keep in mind that during the deployment, the script gets executed by the account running the Tentacle service on that VM and not by your own account (unless you speficifically set the Tentacle to run under your own account). If the account running the Tentacle is going to be running Nunit-console from the path assigned to $nunitpath, you need to make sure to do either of the following:
Deploy Nunit-console along with your package contents, so you make sure the executable is in the right path when the deployment script tries to call it.
Hi Dalmiro
I have both Nunit-console on the PATH environment variable, and the nunit-console.exe in the correct location but still I get:
The term ‘nunit-console’ is not recognized as the name of a cmdlet, function, script file, or operable program.
ObjectNotFound: (nunit-console:String) [], ParentContainsErrorRecordException
Hi again Dalmiro
Some further information, i changed the Octopus service to run under the local system account and the deployment process now sees the nunit-console, however, there is now one more problem but it is nothing to do with Octopus or the Powershell script.
The error is: : SiteCore.BulkyWasteTests.BulkyWasteTests
SetUp : OpenQA.Selenium.WebDriverException : A exception with a null response was thrown sending an HTTP request to the remote WebDriver server for URL http://localhost:65356/session. The status of the exception was ReceiveFailure, and the message was: The underlying connection was closed: An unexpected error occurred on a receive.
According to what I have found on Google, this appears to be a .Net binding problem.
The fact that it worked for Local System Account makes me think the term is not recognized error is still related to the availability of the path in the Environment Variable. Glad to hear you found a workaround for it.
Yeah that other error doesn’t seem related to Octopus at all. More like related to the Selenium drivers, but don’t take my word on that one :).
Good luck with that new error. Hope you find a solution for it soon (or already!).