Report Tool
report-tool
is a command line utility to convert reports into different formats,
merge reports from different formats into different formats and extract attachments,
stdout and stderr from reports to reduce their size.
Supported input formats are HTML, JUnit-XML, JSON and YAML.
Supported output formats are also HTML, JUnit-XML, JSON, YAML. Reports can also be uploaded to a Dashboard.
Usage
The usage is simple. To see all options run report-tool -h
.
usage: report-tool [-h] [-t TITLE] [-H HTML_REPORT] [-x JUNIT_XML_REPORT] [-j JSON_REPORT] [-Y YAML_REPORT] [-r REPORT_SERVER]
[--extract-output] [--extract-attachments]
report [report ...]
report-tool - HILSTER Testing Framework (HILSTER GmbH, https://hilster.io)
positional arguments:
report The input test report. All formats are supported. (may be repeated)
optional arguments:
-h, --help show this help message and exit
-t TITLE, --title TITLE
Output testreport title
-H HTML_REPORT, --html-report HTML_REPORT
Output HTML report filename (may be repeated)
-x JUNIT_XML_REPORT, --junit-xml-report JUNIT_XML_REPORT
Output Junit-compatible XML report filename (may be repeated)
-j JSON_REPORT, --json-report JSON_REPORT
Output JSON report filename (may be repeated)
-Y YAML_REPORT, --yaml-report YAML_REPORT
Output YAML report filename (may be repeated)
-r REPORT_SERVER, --report-server REPORT_SERVER
URL to report server (may be repeated)
--extract-output
Extract STDOUT and STDERR from each test and store it into a text file.
--extract-attachments
Extract attachments and store them locally.
Convert Reports
To convert a report into a different format add the source and add the outputs you want to create.
For example to create a JUnit-XML report from an HTML report run:
report-tool testreport.html --junit-xml-report testreport.xml
And to create all possible file formats run
report-tool testreport.html -x testreport.xml -H new_testreport.html -j testreport.json -Y testreport.yml
Merge Reports
To merge reports add more than one source. All sources are combined automatically. The resulting start time is the minimum start time of all supplied sources. The resulting stop time is the maximum stop time of all supplied sources.
All test report metadata are put into every single test metadata with a prefix 'original'
and the test run metadata is replaced with the sources of the merge and the report-tool
command used.
For example to create an HTML report from an HTML report and a JUnit-XML report run:
report-tool testreport.html results.xml -H merged.html
Upload Reports
To upload a report to your Dashboard use -r
or --report-server
with the url to your
Dashboard and project.
In the following example testreport.html
is uploaded to your Dashboard to project example-project
.
report-tool testreport.html --report-server https://dashboard.lan/example-project
Of course you can also merge and upload reports with a single command.
To merge testreport.html
and results.xml
and upload it run:
report-tool testreport.html results.xml --report-server https://dashboard.lan/example-project
Set the Report Title
To set the report title use -t
or --title
.
report-tool testreport.html --title "New Test Report" -H new_testreport.html
Signed Reports
If all input reports have a valid signature and the signature
feature is enabled in your license
a signature for the output will be created, too.
Extract Attachments
If your HTML report (or another report) contains attachments and is very big so your browser cannot open it anymore you can extract the attachments and write a new report without attachments. The extracted attachments are stored to disk with a reasonable filename and thus can be viewed easily.
To extract attachments from testreport.html
and create stripped.html
run:
report-tool testreport.html --extract-attachments --html-report stripped.html
Extract Output
If your HTML report (or another report) contains stdout and stderr and is very big so your browser cannot open it anymore you can extract stdout and stderr and write a new report without output. The extracted outputs are stored to disk with a reasonable filename and thus can be viewed easily.
To extract attachments from testreport.html
and create stripped.html
run:
report-tool testreport.html --extract-output --html-report stripped.html