pester / AzureDevOpsExtension

MIT License
27 stars 14 forks source link

PowerShell Hangs due missing -NonInteractive #25

Open bormm opened 4 years ago

bormm commented 4 years ago

Where are you running it?

Azure DevOps Service (VSTS) + Self Hosted Agent with Windows 10 + Visual Studio

Version of Extension/Task

Version 10.0.3

Expected behaviour and actual behaviour

My task just does "nothing" and was frozen. I tried to find out what the issue was and started the command from the log manually:

powershell.exe d:\azdevops-build\_tasks\Pester_cca5462b-887d-4617-bf3f-dcf0d3c622e9\10.0.3\Pester.ps1 -TestFolder d:\azdevops-build\1\s\Tests.Pester -resultsFile d:\azdevops-build\1\s\Tests.Pester\Test-Result.xml -run32Bit False -additionalModulePath d:\azdevops-build\1\s/Modules
TestFolder d:\azdevops-build\1\s\Tests.Pester

which results in a

Der Anbieter "nuget v2.8.5.208" ist nicht installiert. "nuget" kann manuell von https://onegetcdn.azureedge.net/providers/Microsoft.PackageManagement.NuGetProvider-2.8.5.208.dll heruntergeladen und installiert werden. Soll PackageManagement automatisch heruntergeladen und "nuget" jetzt installiert werden? [J] Ja [N] Nein [H] Anhalten [?] Hilfe (Standard ist "J"):

So the Task stopped by waiting for some user input, which is of course not possible. The powershell.exe should be started noninteractive like: powershell d:\azdevops-build\_tasks\Pester_cca5462b-887d-4617-bf3f-dcf0d3c622e9\10.0.3\Pester.ps1 -NonInteractive [...]

Steps to reproduce the problem

Start something waiting for interaction.

ChrisLGardner commented 4 years ago

Thanks for reporting this, there's another solution I'll put in place. I'll try to find time for it tomorrow or this weekend.

ChrisLGardner commented 4 years ago

I've published a new version of the extension which should attempt to install nuget 2.8.5.208 from now on if it's not available. That should hopefully resolve this issue as it'll do that regardless of if it's an interactive session or not.

Let me know if you're still having issues and I'll see if there's any better solutions that can be taken.

bormm commented 4 years ago

This specific issue seems to be fixed by this update, but I am wondering how other input related issues could be hard to be found out, if the shell is started interactive and will just hang.

abbgrade commented 1 year ago

It looks like, that it's not fixed in version 10.3.10.