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

Reorganize TestResuls-code into format-specific files #2348

Merged
merged 8 commits into from Jun 7, 2023

Conversation

fflaten
Copy link
Collaborator

@fflaten fflaten commented May 13, 2023

PR Summary

  • Splits code specific to a single format into format-named files (Add support for NUnit3 XML-reports #2208 (comment))
    • Shared helpers and public functions are left in TestResults.ps1 as they're used for both NUnit 2.5 and 3. Same might apply to JUnit4 and ex. JUnit5 in the future.
  • Moves schema-files to format-named folder in dist (Add support for NUnit3 XML-reports #2208 (comment))
  • Updates release.ps1 to verify all mandatory files are available in build
  • Moves Get-HumanTime to Output.ps1 where it's used
  • Deletes unused Exit-WithCode helper.

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)

Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

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

PSScriptAnalyzer found more than 10 potential problems in the proposed changes. Check the Files changed tab for more details.

@fflaten fflaten marked this pull request as draft May 13, 2023 13:54
@@ -301,7 +287,7 @@
$stringWriter = $null
$xmlWriter = $null
try {
$stringWriter = & $SafeCommands["New-Object"] IO.StringWriter
$stringWriter = & $SafeCommands['New-Object'] IO.StringWriter

Check notice

Code scanning / PSScriptAnalyzer

The built-in *-Object-cmdlets are slow compared to alternatives in .NET. To fix a violation of this rule, consider using an alternative like foreach/for-keyword etc.`. Note

The built-in *-Object-cmdlets are slow compared to alternatives in .NET. To fix a violation of this rule, consider using an alternative like foreach/for-keyword etc.`.
@@ -555,7 +374,7 @@
$stringWriter = $null
$xmlWriter = $null
try {
$stringWriter = & $SafeCommands["New-Object"] IO.StringWriter
$stringWriter = & $SafeCommands['New-Object'] IO.StringWriter

Check notice

Code scanning / PSScriptAnalyzer

The built-in *-Object-cmdlets are slow compared to alternatives in .NET. To fix a violation of this rule, consider using an alternative like foreach/for-keyword etc.`. Note

The built-in *-Object-cmdlets are slow compared to alternatives in .NET. To fix a violation of this rule, consider using an alternative like foreach/for-keyword etc.`.
@fflaten
Copy link
Collaborator Author

fflaten commented May 13, 2023

Something to consider: Deprecate public Export/ConvertTo-*UnitResult functions for NUnit and JUnit and expose Export-PesterResult with a new -AsString/PassThru parameter.

@fflaten fflaten marked this pull request as ready for review May 13, 2023 14:25
@fflaten fflaten merged commit 17157de into pester:main Jun 7, 2023
14 checks passed
@fflaten fflaten deleted the testresults-refactor branch June 7, 2023 15:33
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.

None yet

2 participants