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

Ignore excluded/skipped tests and unnecessary setup/teardown using SkipRemainingOnFailure #2442

Merged
merged 8 commits into from May 17, 2024

Conversation

fflaten
Copy link
Collaborator

@fflaten fflaten commented May 4, 2024

PR Summary

  • Refactors plugin to reduce code duplication.
  • Ignores tests excluded by filters or explicitly skipped using -Skip from being marked as skipped by Run.SkipRemainingOnFailure option.
  • Marks relevant blocks as skipped to avoid running BeforeAll/AfterAll

Fix #2440
Fix #2424

PR Checklist

  • PR has meaningful title
  • Summary describes changes
  • PR is ready to be merged
    • If not, use the arrow next to Create Pull Request to mark it as a draft. PR can be marked Ready for review when it's ready.
  • Tests are added/update (if required)
  • Documentation is updated/added (if required)

@fflaten fflaten marked this pull request as draft May 4, 2024 22:57
@fflaten fflaten changed the title Ignore excluded and skipped tests in GetSkipRemainingOnFailure GetSkipRemainingOnFailure - Ignore excluded/skipped tests and unnecessary setup/teardown May 4, 2024
@fflaten fflaten changed the title GetSkipRemainingOnFailure - Ignore excluded/skipped tests and unnecessary setup/teardown Ignore excluded/skipped tests and unnecessary setup/teardown using SkipRemainingOnFailure May 4, 2024
@fflaten fflaten marked this pull request as ready for review May 5, 2024 13:10
@@ -29,41 +54,18 @@ function Get-SkipRemainingOnFailurePlugin {
$p.Start = {
param ($Context)

# TODO: Use $Context.GlobalPluginData.SkipRemainingOnFailure.SkippedCount when exposed in $Context
Copy link
Member

Choose a reason for hiding this comment

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

Is this something you will address in this PR or there should be issue created for this?

Copy link
Collaborator Author

@fflaten fflaten May 14, 2024

Choose a reason for hiding this comment

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

New issue. Didn't want to touch plugin interface as it wasn't critical.

I'm happy to provide a follow-up PR when name and steps (all?) are decided.

@nohwnd nohwnd merged commit c9c380d into pester:main May 17, 2024
14 checks passed
@fflaten fflaten deleted the fix-skipremaining branch May 17, 2024 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants