feat: Add JSON, YAML, and Toon output options for zpm test results #979
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Feature: Add Multi-Format Output (Toon, JSON, YAML) to
zpm testfixes #971
Summary
This Pull Request includes significant flexibility to the
zpm testcommand by allowing users to define the output format for both terminal display and file generation. This enhancement supportsToon(default),JSON, andYAMLformats, improving integration with external reporting tools and overall user experience.1. Terminal Output Control via
-f/-outputFlagThe new optional flag,
-f(or-output), allows users to specify the desired output format of the test results displayed directly in the terminal (stdout).Toon,Json,YamlToonformat.Interaction with Verbose Flag (
-v):-v): If the-v(verbose) flag is not defined, the selected format will be displayed to the terminal.-v) is defined in the command, the-fflag is ignored, and no output summary is displayed (maintaining the existing verbose behavior).Example Toon Output Structure (Terminal):
2. Dedicated Configuration Directives for File Generation (
-D)The existing configuration directive logic (
-D) used for file output (e.g.,-DUnitTest.JUnitOutput) has been extended to support the new formats to easily generate and store results files.The following new configuration directives are now supported:
-DUnitTest.JsonOutput/path/to/testresult.json-DUnitTest.YamlOutput/path/to/testresult.yaml-DUnitTest.ToonOutput/path/to/testresult.toonExample File Generation Command:
zpm "zpm test -only -DUnitTest.JsonOutput=/usr/irissys/mgr/user/testresult/testresult.json"Unit Test Verification
A dedicated unit test class,
Test.PM.Unit.TestResultsOPFormatAndFileGenTest, has been created to thoroughly test the new file generation functionality for all three formats.The test results below confirm that files are successfully generated and then cleaned up: