JetBrains / integration-tests-vm-scripts

How to wrap TeamCity NUnit Runner with powershell?
Apache License 2.0
4 stars 9 forks source link

Exception thrown from PowerOn.ps1 #1

Open borismod opened 10 years ago

borismod commented 10 years ago

I invoke the Integration test as shown below. It fails on the binding of the parameters.

.\Platform\build\TestProduct\Impl\IntegrationTests.ps1 -GuestCredentials "guest_login","pass" -FilesToTest "C:\Tests" -cloneNamePattern "Win7-64bit-TS51-SQL" -VmName "Win7-64bit-TS51-SQL_20140723+Clean" -ViServerData VCenter, USERNAME, PASSWORD

Cannot bind positional parameters because no names were given. At C:\Users\boris.m\Documents\GitHub\TeamCity-extensions\Platform\build\TestProduct\Impl\InTest\PowerOn.ps1:38 char:39

van800 commented 10 years ago

Something was not clear in my doc (I will update it a bit later) 1) Must be: -FilesToTest "C:\Tests\dllname1.dll" 2) Make simple but unique cloneNamePattern like "123".

Check at vcenter, what is actually done. Was the clone created, powered?

Normally for troubleshooting you should go deeper and directly run PowerOn.ps1 or VirtualEnvironment.ps1. It will give you the understanding what is going wrong.

I have rechecked the execution:

  1. so I open cmd and go to TeamCity-extensions folder
  2. run powershell
  3. put in the line (I have just rechecked with this one) .\Platform\build\TestProduct\Impl\IntegrationTests.ps1 -GuestCredentials "guest_login","pass" -FilesToTest "C:\Tests\1.dll" -cloneNamePattern "123" -VmName "Win7x64+noVS" -ViServerData address.net, domain\login, password
borismod commented 10 years ago

Ivan, thank you for your reply. Let me just understand:

  1. I remember that there is some logic that extracts date from VM name. Am I right? Do I have to name my VM with the date pattern: Win7_20140723 ?
  2. Regarding the test assembly, does it have to be something special, or just regular NUnit test dll?
  3. The initial problem I encountered was with the binding of parameters. When I replaced that logic that invokes job with simple call to the script it worked better. But get stuck later when was waiting for the VM for 320 seconds. I can see that the VM is On and ready but the script stopped working saying that the vm is not ready.
van800 commented 10 years ago

Boris, 1) no. the date is added by script. Result name of the clone is formed like: cloneNamePattern date time VmName "clone". Later we will stop all machines which start with cloneNamePattern and delete some of them, which are old. 2) Yes. My assemblies are special. They get ip, username and password and run some activities at the remote machines. 3) Check that you have vmware tools installed at the machine and that the machine has network.

van800 commented 10 years ago

addition to 2) For testing: Please try to put there simple nunit dll. However it will simply run at the powershell machine, not in the remote one.