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

Suppress error messages when Powershell Gallery isn't reachable - fixes #18 #36

Merged
merged 4 commits into from
Jun 13, 2020

Conversation

jhampson-dbre
Copy link

What problem does this PR address?

Fixes error messages being written when Powershell Gallery is not reachable from the pipeline, which causes the Pester task to fail even though the tests are executed as expected

Is there a related Issue?

#18

Hampson Jared added 3 commits June 10, 2020 15:49
When PowershellGallery is not reachable (e.g. on an airgapped build server), the Find-Module command writes an error message stating that it cannot find the given module (in this case, Pester). This error message caused the Pester extension task to fail when used in an Azure DevOps pipeline, even though the tests would be executed as expected.

To fix this, we set errors from Find-Module to be terminating errors so they can be handled by the try/catch block and fall back to the bundled Pester module.
@jhampson-dbre
Copy link
Author

jhampson-dbre commented Jun 10, 2020

@ChrisLGardner I had to make some changes to the Helper.Tests.ps1 in order to get it to run before making any other changes. Just a heads up in case this was due to me running it on a different Pester version (I ran with Pester 4.10 on Windows Powershell 5.1) than it was written with or something.

Fix typo on HelperModule import
@ChrisLGardner
Copy link
Collaborator

LGTM, I'll get this released now.

@ChrisLGardner ChrisLGardner merged commit 8e61d26 into pester:master Jun 13, 2020
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

Successfully merging this pull request may close these issues.

2 participants