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

win_pester path behavior changed to match Pester behavior #56061

Open
wants to merge 8 commits into
base: devel
from

Conversation

Projects
None yet
3 participants
@clcaldwell
Copy link

commented May 3, 2019

SUMMARY

fix supplying directory path to only execute *.tests.ps1 files, using Pester's built-in test searching functionality.

Fixes #55736

ISSUE TYPE
  • Bug Fix Pull Request
COMPONENT NAME

win_pester

ADDITIONAL INFORMATION

Previously, win_pester would search for '.ps1' files in the directory supplied to 'Path:', and then execute 'Invoke-Pester' against each file. This is different from Pester's behavior, which only executes against '.tests.ps1' files. Due to this divergent behavior, the win_pester module could inadvertently execute code that changes your system state when you are attempting to execute tests.

Pester also will search supplied paths itself, so searching for the the files to execute within the win_pester module was unnecessary.

clcaldwell added some commits May 3, 2019

fix supplying directory path to only execute *.tests.ps1 files, using…
… Pester's built-in test searching functionality.
@ansibot

This comment has been minimized.

@ansibot

This comment has been minimized.

Copy link
Contributor

commented May 3, 2019

@ansibot ansibot added the test label May 3, 2019

@clcaldwell

This comment has been minimized.

Copy link
Author

commented May 3, 2019

Looks like the tests are failing because it is unable to convert the $results object into a string on calling Exit-Json. None of the changes I've made would seem to be the cause of this, although I'm open to being proved wrong.

@samdoran samdoran removed the needs_triage label May 14, 2019

@ansibot ansibot added stale_ci and removed stale_ci labels May 14, 2019

@clcaldwell clcaldwell force-pushed the clcaldwell:win_pester_path_fix branch from f67a186 to 8fa87f4 May 20, 2019

@clcaldwell clcaldwell force-pushed the clcaldwell:win_pester_path_fix branch from 8fa87f4 to 256bf22 May 20, 2019

@clcaldwell clcaldwell force-pushed the clcaldwell:win_pester_path_fix branch from e4bf1f8 to 6896899 May 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.