Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pester script is hanging after the recent Pull Requests #60

Open
ArturHoman opened this issue Jan 12, 2021 · 6 comments
Open

Pester script is hanging after the recent Pull Requests #60

ArturHoman opened this issue Jan 12, 2021 · 6 comments

Comments

@ArturHoman
Copy link

ArturHoman commented Jan 12, 2021

There is a Pester script processed with Azure Devops task "Pester Test Runner" and It has been detected as broken within version 9.4.0 and it worked for 9.3.0.
It is not related to the agent because it is hanging within Azure Pipelines agents too and there were no changes in the custom pool.
The current behavior: the task is going to be started for minutes.
Expected (previous) behavior: the task executes simple pester scripts for <2 minutes.

@ChrisLGardner
Copy link
Collaborator

Hi

Can you try running the pipeline with diagnostics enabled and sharing the logs? You can enable diagnostics by setting the system.debug variable to true at queue time.

Thanks.

@ArturHoman
Copy link
Author

ArturHoman commented Jan 12, 2021

Hi, please see below:
`[section]******************************************************************************
[section]Starting: TASK NAME
[section]******************************************************************************

Task : Pester Test Runner
Description : Run Pester tests by either installing the latest version of Pester at run time (if possible) or using the version shipped with the task (4.10.1)
Version : 9.4.0
Author : Pester
Help : Version: #{Build.BuildNumber}#. More Information

[debug]agent.TempDirectory=PATH_temp
[debug]loading inputs and endpoints
[debug]loading ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN
[debug]loading ENDPOINT_AUTH_SCHEME_SYSTEMVSSCONNECTION
[debug]loading ENDPOINT_AUTH_SYSTEMVSSCONNECTION
[debug]loading INPUT_PESTERVERSION
[debug]loading INPUT_RESULTSFILE
[debug]loading INPUT_RUN32BIT
[debug]loading INPUT_SCRIPTFOLDER
[debug]loading INPUT_USEPSCORE
[debug]loading SECRET_

[debug]loading SECRET_
[debug]loaded 18
[debug]Agent.ProxyUrl=undefined
[debug]Agent.CAInfo=undefined
[debug]Agent.ClientCert=undefined
[debug]Agent.SkipCertValidation=undefined
[debug]scriptFolder=@{Path="ROOT_PATH\SCRIPT.Tests.ps1"; Parameters=@{AppUrl="URL"; Token="";}}
[debug]resultsFile=ROOT_PATH\Deployment-Test-Pester.XML
[debug]run32Bit=False
[debug]additionalModulePath=undefined
[debug]Tag=undefined
[debug]ExcludeTag=undefined
[debug]CodeCoverageOutputFile=undefined
[debug]CodeCoverageFolder=undefined
[debug]ScriptBlock=undefined
[debug]PesterVersion=LatestVersion
[debug]System.Debug=true
[debug]AGENT.OS=Windows_NT
[debug]usePSCore=false
Using executable 'powershell.exe'
powershell.exe PATH_tasks\Pester_cca5462b-887d-4617-bf3f-dcf0d3c622e9\9.4.0\Pester.ps1 -scriptFolder @{Path="ROOT_PATH\SCRIPT.Tests.ps1"; Parameters=@{AppUrl="URL"; Token="
";}} -resultsFile ROOT_PATH\Deployment-Test-Pester.XML -run32Bit False -Verbose`

And it is not able to continue, it is possible to cancel only.
PS version = 5.1

@ArturHoman ArturHoman changed the title Pester script is handing after the recent Pull Requests Pester script is hanging after the recent Pull Requests Jan 22, 2021
@snehitgajjar
Copy link

We are also seeing this behavior for v10. For us we were able to debug that it hangs because it is trying to install nuget package provider and waiting for user input.


The provider 'nuget v2.8.5.208' is not installed.
nuget may be manually downloaded from https://onegetcdn.azureedge.net/providers/Microsoft.PackageManagement.NuGetProvider-2.8.5.208.dll and installed.
Would you like PackageManagement to automatically download and install 'nuget' now?
[Y] Yes [N] No [S] Suspend [?] Help (default is "Y"):

Based on this it shouldn't happen.

Install-PackageProvider -Name Nuget -RequiredVersion 2.8.5.208 -Scope CurrentUser -Force -Confirm:$false -ErrorAction Stop

@snehitgajjar
Copy link

@ChrisLGardner Any help on this is helpful.

@vlad-m-r
Copy link

vlad-m-r commented Aug 2, 2021

Can confirm. Pester runner is unable to install a package non-interactively.

C:\a_work\1\s>powershell.exe C:\a_work\_tasks\Pester_cca5462b-887d-4617-bf3f-dcf0d3c622e9\10.3.10\Pester.ps1 -TestFolder C:\a_work\1\s\PesterTestsV5\* -resultsFile C:\a_work\1\s\Test-Pester.XML -run32Bit False -FailOnStdErr true -TargetPesterVersion 5.0.0
TestFolder C:\a_work\1\s\PesterTestsV5\*
resultsFile C:\a_work\1\s\Test-Pester.XML
run32Bit False
additionalModulePath
tag
ExcludeTag
CodeCoverageOutputFile
CodeCoverageFolder
ScriptBlock
FailOnStdErr trueThe provider 'nuget v2.8.5.208' is not installed.
nuget may be manually downloaded from https://onegetcdn.azureedge.net/providers/Microsoft.PackageManagement.NuGetProvider-2.8.5.208.dll and installed.
Would you like PackageManagement to automatically download and install 'nuget' now?
[Y] Yes [N] No [S] Suspend [?] Help (default is "Y"):

Also, I assume the installation is triggered somewhere from here:

https://github.com/pester/AzureDevOpsExtension/blob/master/Extension/PesterTask/PesterV10/HelperModule.psm1#L45

That Install-PackageProvider cmdlet finishes successfully and installs package non-interactively

@daveblount
Copy link

I too am seeing his issue.
I've tried explicitly installing nuget in a Powershell ADO task immeditelay prior to the Pester test Runner task.
Using:-
Install-PackageProvider NuGet -Force

But the problem persists on the execution of the Pester Test Runner task.
Curious as to how this is not affecting everyone? Any workarounds suggested? Or fixes coming?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants