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

Need guidance for how to run v4 and v5 side-by-side #136

Open
johndog opened this issue Jul 23, 2021 · 1 comment
Open

Need guidance for how to run v4 and v5 side-by-side #136

johndog opened this issue Jul 23, 2021 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@johndog
Copy link

johndog commented Jul 23, 2021

v5 is a massive breaking change. Anyone with a sizeable body of v4 tests will not be able to migrate all at once, and may not even own the ability to migrate completely. For migration to be possible for such people, they need to know how to run v5 for 1%, 10% or 90% of their tests, and still be able to run the remainder with v4.

Tips needed:

  1. How to install both v4 and v5 side-by-side, such that v4 is the default version
  2. How to annotate v5 tests so that v5 is used automatically when they are run
    • Should also mention how to annotate v4 tests for clarity, but recognize that it may be impossible to change some legacy content

A focus on this scenario will improve v5 adoption dramatically. (speaking from experience on breaking changes in general, and the lack of tools for dealing with the move to v5 has also been an inhibiting factor for me personally)

@fflaten
Copy link
Collaborator

fflaten commented Aug 2, 2022

I agree there could be a few tips in ex. the migration-guide. Not sure what though as it all depends on workflow, project folder-structure etc. Feel free to submit a PR if you have some ideas and experience. 🙂

Initial thoughts:

  • V4 and v5 should be executed in different powershell-processes. Jobs could be problematic due to a stack size-limitation in PowerShell, so would use another process if possible.
  • Import-Module Pester -MaximumVersion 4.99 for v4-process
  • Separate in tst/v4 and tst/v5 folders, or use a different extension for v5 like .testsv5.ps1 (configurable in Run.TestExtension-option). Depends on project tbh.
  • Result/reporting depends on project. There's https://pester.dev/docs/commands/ConvertTo-Pester4Result if powershell-script is used to parse results. Both support NUnit2.5 xml if CI supports that.

@fflaten fflaten added the documentation Improvements or additions to documentation label Jun 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants