GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Pester v5 by bergmeister · Pull Request #1444 · PowerShell/PSScriptAnalyzer

Conversation

@bergmeister

@bergmeister Christoph Bergmeister (bergmeister) commented Apr 17, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

PR Summary

Migration to use new Pester v5.
It has cleaner scoping and test setup has to go into a BeforeAll block, except for things that need to be evaluated at discovery time (therefore test cases also had to be inlined), see https://github.com/pester/Pester/blob/v5.0/README.md
Some cleanup had to be done as part of it. PSScriptAnalyzer is now only imported once before running tests (import is needed as some tests reference the PSSA types). Some tests were also cleaned up to not depend on PSScriptAnalyzerTestHelper.psm1 any more. I also started adding the Copyright header to the test files. The speed of test execution is roughly the same as v4.

A diff that ignores indentation/whitespace will make the review much easier
image

I suggest we wait for the GA of v5 but the PR is already ready.

PR Checklist

  • PR has a meaningful title
    • Use the present tense and imperative mood when describing your changes
  • Summarized changes
  • Change is not breaking
  • Make sure all .cs, .ps1 and .psm1 files have the correct copyright header
  • Make sure you've added a new test if existing tests do not effectively test the code changed and/or updated documentation
  • This PR is ready to merge and is not Work in Progress.
    • If the PR is work in progress, please add the prefix WIP: to the beginning of the title and remove the prefix when the PR is ready.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Christoph Bergmeister added 30 commits April 12, 2020 21:00
Christoph Bergmeister
Replace usage of $MyInvocation.MyCommand.Pat with $PSScriptRoot and c…
2811ab7
…leanup tests
Christoph Bergmeister
Fix 2 small mistakes, test should now be green again
d4f54f5
Christoph Bergmeister
Adapt build.psm1
eeb251f
Christoph Bergmeister
Engine tests migration to Pester v5
36d213a
Christoph Bergmeister
use pester v5 in ci and always upload test results
b25714d
Christoph Bergmeister
Upgrade Rule tests to Pester v5 using BeforeAll block and addressing …
a498236
…some -Skip problems already
Christoph Bergmeister
-AllowPrerelease
765aad3
Christoph Bergmeister
try bootstrap in wmf4
7a67f0e
Christoph Bergmeister
fix invoke-pester call in CI
9d17571
Christoph Bergmeister
fix CorrectionExtent.tests.ps1
2de4c20
Christoph Bergmeister
fix Helper.tests.ps1
a10983e
Christoph Bergmeister
Fix remaining tests with BeforeAll/AfterAll (discovery works now)
c6dd640
Christoph Bergmeister
fix UseUsingScopeModifierInNewRunspaces.tests.ps1
35ed07c
Christoph Bergmeister
make test cases more readable
a350f2b
Christoph Bergmeister
cleanup UseUsingScopeModifierInNewRunspaces.tests.ps1
5350e87
Christoph Bergmeister
Fix UseShouldProcessForStateChangingFunctions.tests.ps1
f2e37f3
Christoph Bergmeister
cleanup UseShouldProcessForStateChangingFunctions.tests.ps1
2a9fa9f
Christoph Bergmeister
Fix PSCompatibilityCollector/Tests/UtilityApi.Tests.ps1
a5df593
Christoph Bergmeister
Fix InvokeScriptAnalyzer.tests.ps1
b6e6fda
Christoph Bergmeister
Format InvokeScriptAnalyzer.tests.ps1
bce0a88
Christoph Bergmeister
Fix ModuleHelp.Tests.ps1 and cleanup
afb1b98
Christoph Bergmeister
Fix RuleSuppression.tests.ps1
3413419
Christoph Bergmeister
Fix Settings.tests.ps1
350f840
Christoph Bergmeister
format Settings.tests.ps1
6bdf977
Christoph Bergmeister
Fix Tests/Engine/TextEdit.tests.ps1 and format
f5ef381
Christoph Bergmeister
Fix AllCompatibilityRules.Tests.ps1
184081f
Christoph Bergmeister
Fix AvoidUnloadableModuleOrMissingRequiredFieldInManifest.tests.ps1
8c43725
Christoph Bergmeister
Format AvoidUnloadableModuleOrMissingRequiredFieldInManifest.tests.ps…
be4b0a2
…1 to fix indentation
Christoph Bergmeister
Fix AvoidUsingPlainTextForPassword.tests.ps1
51a9fa9
Christoph Bergmeister
fix place*brace tests
78ff1ab
@bergmeister Christoph Bergmeister (bergmeister) changed the title Pester v5-rc7 Pester v5-rc8 May 14, 2020
@bergmeister
Update appveyor.psm1
53f1f0b
@bergmeister Christoph Bergmeister (bergmeister) changed the title Pester v5-rc8 Pester v5-rc9 May 16, 2020
Christoph Bergmeister added 10 commits May 16, 2020 10:02
Christoph Bergmeister
Merge branch 'master' of https://github.com/powershell/PSScriptAnalyzer…
98fdaf5
… into pesterv5PoC
Christoph Bergmeister
don't use -CI switch for local build and disable code coverage in CI
4b4a976
Christoph Bergmeister
import pester module before running tests to import types
e6d1497
Christoph Bergmeister
fix property name
1dff12d
Christoph Bergmeister
actually use configuration object (doh)
1bd9e96
Christoph Bergmeister
config object
b683115
Christoph Bergmeister
fix output verbosity
edfbd10
Christoph Bergmeister
fix type casting of [string[]] of pester paths
570d287
Christoph Bergmeister
pester 5 GA
8baab13
Christoph Bergmeister
Merge branch 'master' of https://github.com/powershell/psscriptanalyzer…
752307e
… into pesterv5PoC

# Conflicts:
#	Tests/Rules/UseUsingScopeModifierInNewRunspaces.tests.ps1
@bergmeister Christoph Bergmeister (bergmeister) changed the title Pester v5-rc9 Pester v5 May 27, 2020
@bergmeister
Christoph Bergmeister (bergmeister) marked this pull request as ready for review May 27, 2020 17:20
@bergmeister

Christoph Bergmeister (bergmeister) commented May 27, 2020

Copy link
Copy Markdown
Collaborator Author

Rob Holt (@rjmholt) James Truher (@JamesWTruher) Pester v5 has released today after multiple RC iterations. It's much cleaner but a tad slower, especially on PowerShell 5.1, which hasn't back-ported the speculative execution perf fix PowerShell/PowerShell#10269
Do you think it's worthwhile merging already as it might make porting of tests to PSSA v2 test easier/cleaner?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bergmeister
Pester 5.0.2
b4eb871
rjmholt
Rob Holt (rjmholt) reviewed Jun 2, 2020
View reviewed changes

@rjmholt Rob Holt (rjmholt) left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Part way through the review, will continue later

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bergmeister reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread PSCompatibilityCollector/Tests/UtilityApi.Tests.ps1 Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Tests/Engine/CustomizedRule.tests.ps1 Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Tests/Engine/InvokeScriptAnalyzer.tests.ps1 Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Tests/Engine/InvokeScriptAnalyzer.tests.ps1 Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Tests/Engine/InvokeScriptAnalyzer.tests.ps1 Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Tests/Engine/CustomizedRule.tests.ps1 Resolved

Uh oh!

There was an error while loading. Please reload this page.

rjmholt
Rob Holt (rjmholt) approved these changes Jun 4, 2020
View reviewed changes
Christoph Bergmeister added 8 commits June 7, 2020 20:56
Christoph Bergmeister
move testcases declaration before test
932ca10
Christoph Bergmeister
remove left-over comments
b540737
Christoph Bergmeister
remove unnecessary [bool] in if condition
ea23a46
Christoph Bergmeister
simplify version check to not require [version] type and patch version
6a44a18
Christoph Bergmeister
fix missing whitespace in test that made test invalid
5ee8a38
Christoph Bergmeister
empty commit since Azure Pipelines did not trigger
1619ad8
Christoph Bergmeister
empty commit since Azure Pipelines did not trigger again
6a13f04
Christoph Bergmeister
empty commit since Azure Pipelines did not trigger again
3b21278
@bergmeister
Christoph Bergmeister (bergmeister) merged commit 7354892 into PowerShell:master Jun 11, 2020
@clcaldwell Coby Caldwell (clcaldwell) mentioned this pull request Mar 23, 2021
Locally running ./build.ps1 -Tests does not function as docs specify #1652
Open
@rjmholt Rob Holt (rjmholt) mentioned this pull request Jul 14, 2021
Script scope variables not defined for tests pester/Pester#2028
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@JamesWTruher James Truher (JamesWTruher) Awaiting requested review from JamesWTruher
1 more reviewer
@rjmholt Rob Holt (rjmholt) rjmholt approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

Area - Test

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@bergmeister @rjmholt
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.