-
-
Notifications
You must be signed in to change notification settings - Fork 476
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
Improve export #1210
Improve export #1210
Conversation
- Improve/fix NUnit output for PSpec and Gherkin - Reword main test suite name from 'Pester' to 'Pester Specs'/'Features' - Write description attribute at first position on test suites (like test cases) - Fix Gherkin NUnit output: test suites with failures were reported as success - Include feature name in full qualified names in Gherkin NUnit reports - Add additional output format HTML for Invoke-Pester and Invoke-Gherkin - Reincarnation of pull request pester#1186 with various improvements - PowerShell only code (no XSLT) in Functions/Export/Html.ps1 - Regard parameterized test cases (were not nested correctly) - Count total, passed, inconclusive and failed results by three groups - Files/Groups/Specs for Pester Specs - Features/Scenarios/Steps for Gherkin - Include summary of information like PowerShell version, date/time, culture info, operation system or duration - HTML output is also XHTML to allow easier testing - Add extensive tests for Gherkin HTML reports - Add smaller set of tests for PSpec HTML reports which should be sufficient - Regard HTML encoding - Changes should be backward compatible since string parameters for output file and format were replaced by string[] - Refactor TestResults.ps1 - Create test report object and pass it as top level element to NUnit and HTML export functions - Remove not used function Get-TestTime - Move NUnit specific code to Functions/Export/NUnit.ps1 - Rename Get-NUnitGroupResult to Get-NUnitTestSuiteResult - Use inner functions in NUnit.ps1 to avoid repeated arguments (e.g. for XMLWriter) - Add new internal functions - New-TestReport - New-TestResult - Group-TestResult - New-TestResultTree - ConvertTo-TestResult - Create separate module for shared test code - Create functions Get-XmlNode, Get-XmlInnerText, Get-XmlValue, Get-XmlCount and Get-NextPreText - Store it in Dependencies/TestUtilities/TestUtilities.psm1 - Use it in Gherkin.Tests.ps1 and TestResults.Tests.ps1 - Remove it before release in cleanUpBeforeBuild.ps1 - Add NUnit output test for correct names on all levels - Improve Gherkin NUnit tests - Add expected description values for features, scenarios and steps - Fix expected name values for scenarios and steps
7f55a7c
to
332736b
Compare
@cgnuechtel Thanks for the PR, it will take me some time to reivew it. |
@cgnuechtel I am not sure if this was intentional - but there is some interesting behavior you have introduced now that -OutputFormat is [string[]] .
Similarly: So, I guess the question is: If you are going to offer multiple output formats, should you validate that the results are getting written into a valid file - or do some correction for mis-orded inputs on -OutputFile? |
@clcaldwell As I remember, that was intended. The output file is just a name and has no special checks. @nohwnd Any plans to include this pull request or is it outdated now? |
@cgnuechtel Just to clarify what I mean with this: |
Thank your for the PR, as I said in my previous comments, I am not very interested in adding another output because I would have to support it in the future. Please feel free publishing this on your own as a module. |
This pull requests improves the export of Pester test results.
I am opening this pull request because of the following comments:
(both from PR #1186)
The code has the following characteristics:
Also, I carefully compared the output of my changes with the last output of the master.
It is the same (without time values).
I am still convinced, that Pester should support a small amount of some standard outputs say like Cucumber.
I think the following formats would be fine:
More output formats could be provided as extra modules.
The following issues/pull requests I have been found about output/NUnit results.
Hopefully I'm not too overwhelming.
The code I have been provided can be uses as it is.
Or can used as starting point of discussion about the topic.
By the way: the object which is returned by
passthru
parameter seems not to be sufficient for me so I used the internal Pester state object.Please give feedback to the code!
I would highly appreciate suggestions for improvements!