Logs and reports
Logs
The framework produces LZMA compressed logs that contains JSON encoded messages. For example,
1 | {"message_keyword":"TEST","message_hash":"ccd1ad1f","message_object":1,"message_num":2,"message_stream":null,"message_level":1,"message_time":1593887847.045375,"message_rtime":0.001051,"test_type":"Test","test_subtype":null,"test_id":"/68b96288-be25-11ea-8e14-2477034de0ec","test_name":"/My test","test_flags":0,"test_cflags":0,"test_level":1,"test_uid":null,"test_description":null} |
Each message is a JSON object. Object fields depend on the type of message that is specified by the message_keyword.
Logs can be decompressed using either the standard xzcat utility
1 | xzcat test.log |
or tfs transform decompress command
1 | cat test.log | tfs transform decompress |
Saving Log File
Test log can be saved into a file by specifying -l or --log option when running the test. For example,
1 | python3 test.py --log test.log |
Transforming Logs
Test logs can be transformed using tfs transform command. See tfs transform --help
for a detailed list of available transformations.
nice
The tfs transform nice command can be used to transform test log into a nice output format which the default output
used for the stdout.
For example,
1 | cat test.log | tfs transform nice |
1 | Jul 04,2020 19:20:21 ⟥ Module filters |
short
The tfs transform short command can be used to transform test log into a short output format that contains test procedures
and test results.
For example,
1 | cat test.log | tfs transform short |
1 | Module filters |
slick
The tfs transform slick command can be used to transform test log into a slick output format that contains only test names
with results provided as icons in front of the test name. This output format is very concise.
For example,
1 | cat test.log | tfs transform slick |
1 | ➤ Module filters |
dots
The tfs transform dots command can be used to transform test log into a dots output format, which outputs dots
for each executed test.
For example,
1 | cat test.log | tfs transform dots |
1 | ......................... |
raw
The tfs transform raw command can be used to transform a test log into a raw output format that contains raw JSON
messages.
For example,
1 | cat test.log | tfs transform raw |
1 | {"message_keyword":"PROTOCOL","message_hash":"489eeba5","message_object":0,"message_num":0,"message_stream":null,"message_level":1,"message_time":1593904821.784232,"message_rtime":0.001027,"test_type":"Module","test_subtype":null,"test_id":"/ee772b86-be4c-11ea-8e14-2477034de0ec","test_name":"/filters","test_flags":0,"test_cflags":0,"test_level":1,"protocol_version":"TFSPv2.1"} |
compact
The tfs transform compact command can be used to transform a test log into a compact format that only contains
raw JSON test definition and result messages while omitting all messages for the steps.
It is used to create compact test logs used for comparison reports.
compress
The tfs transform compress command is used to compress a test log with LZMA compression algorithm.
decompress
The tfs transform decompress command is used to decompress a test log compressed with LZMA compression algorithm.
Creating Reports
Test logs can be used to create reports using tfs report command. See tfs report --help for a list of available reports.
Results Report
A results report can be generated from a test log using tfs report results command.
The report can be generated in either Markdown format (default) or JSON format
by specifying --format json option.
The report in Markdown can be converted to HTML using tfs document convert command.
1 | Generate results report. |
For example,
1 | cat test.log | tfs report results | tfs document convert > report.html |
Coverage Report
Requirements coverage report can be generated from a test log using tfs report coverage command. The report is created in Markdown
and can be converted to HTML using tfs document convert command. For example,
1 | Generate requirements coverage report. |
For example,
1 | cat test.log | tfs report coverage requirements.py | tfs document convert > coverage.html |
Metrics Report
You can generate metrics report using tfs report metrics command.
1 | Generate metrics report. |
Comparison Reports
A comparison report can be generated using one of the tfs report compare commands.
1 | Generate comparison report between runs. |
Compare Results
A results comparison report can be generated using tfs report compare results command.
1 | Generate results comparison report. |
Compare Metrics
A metrics comparison report can be generated using tfs report compare metrics command.
1 | Generate metrics comparison report. |
Specification Report
A test specification for the test run can be generated using tfs report specification command.
1 | Generate specifiction report. |
Test Results
Any given test will have one of the following results.
OK
Test has passed.
Fail
Test has failed.
Error
Test produced an error.
Null
Test result was not set.
Skip
Test was skipped.
XOK
OK result was crossed out. Result is considered as passing.
XFail
Fail result was crossed out. Result is considered as passing.
XError
Error result was crossed out. Result is considered as passing.
XNull
Null result was crossed out. Result is considred as passing.