Skip to content

Conversation

@corbob
Copy link
Contributor

@corbob corbob commented Jan 9, 2025

PR Summary

Add Reasons to block and test results. Allowing for providing a reason when skipping a block with -Skip, or seeing the reported reason when using Set-ItResult.

Fixes #2049

Testing steps

Below are the steps that I took to test this change:

  1. Checkout this PR.
  2. Run .\build.ps1 -Clean
  3. Run .\2049-tests\mytests.ps1
  4. Inspect each of the generated xml files to validate that the message is present.

A few things I'm not sure on:

  1. Does the XML correctly parse in tools that use the xml?
  2. This feels like there should be tests wrapped around it. Where should those tests go?
  3. What about documentation?

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)

This adds a reason property onto Block and Test results. Currently if
you Skip a block using `-Skip` you cannot provide a reason for your
skip. While if you use `Set-ItResult` to skip a test you're able to
provide a reason for the result you're setting. Unfortunately with a
Skip result, that reason is not bubbled up to the test results files.
This add some tests for what was run manually for testing this out. It
is expected that this commit will not be included when the PR is merged,
but it is valuable for getting to the point of being able to merge.
@corbob corbob marked this pull request as ready for review December 11, 2025 23:45
@corbob
Copy link
Contributor Author

corbob commented Dec 11, 2025

oooh... I had marked this as ready for review as I thought I was ready, but I see from the checks that the answer to my unknown about where to put tests is probably around where there are failing tests because reasons have been added... I guess I'll convert it back to draft until I've had an opportunity to look at that one.

@corbob corbob marked this pull request as draft December 11, 2025 23:47
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.

Feature: Add a -Reason parameter when using the -Skip switch

1 participant