twister: Improve recording at Harness

The Console Harness is able to parse its log with patterns to compose
extracted fields into records in 'recording.csv' file in the test's build
directory. This feature allows to extract custom test results like
performance counters.
With this change the extracted records are also written into 'twister.json'
as a part of each test suite object. This makes easier to store
all the data collected by the test for its further processing.

Other improvements:
 - compile parsing pattern only once instead of at each input line;
 - quote fields in '.csv' to avoid unexpected field separators;
 - make 'regex' a required schema field of 'harness_config';
 - Twister documentation update.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
This commit is contained in:
Dmitrii Golovanov 2023-12-01 21:19:09 +01:00 committed by Anas Nashif
commit 47da4e2e76
8 changed files with 69 additions and 50 deletions

View file

@ -347,6 +347,10 @@ class Reporting:
testcases.append(testcase)
suite['testcases'] = testcases
if instance.recording is not None:
suite['recording'] = instance.recording
suites.append(suite)
report["testsuites"] = suites