Commit Graph

15 Commits

Author SHA1 Message Date
Thilo Fromm
d66ab2b2c3 tapfile_helper: fix foldable details output
This change adds a "<summary>" sub-block to the "<details>" block in
markdown test reports.

The test run details output, which is used to print debug and error
messages of test runs in case of test failures, was meant to be
fold-able, aiding readability of test reports. This is implemented using
the "<details>" feature. However, we forgot to mark a "<summary>" line
within the "<details>" block, leading to the blocks not being fold-able
but instead being visible all the time.

Signed-off-by: Thilo Fromm <thilofromm@microsoft.com>
2023-05-03 10:57:02 +02:00
Thilo Fromm
f07cb5f781 tapfile_helper ff.: support TAP and Markdown output
This change adds markdown output support to tapfile helper.
tap_generate_report() has been refactored to use low-level output
functions to write tests; TAP and markdown output is supported and both
are generated by default. Also, it should be straightforward to add
other output formats by implementing the respective low level print
functions.

The markdown output is now used by run-kola-tests.yaml to generate step
output and, if run from a PR, add a comment with test results to the PR.

Signed-off-by: Thilo Fromm <thilofromm@microsoft.com>
2023-03-29 21:05:47 +02:00
Krzesimir Nowak
698d0de129 ci-automation: Trivial fixes
Dropped some trailing whitespace, fixed a typo. Trivial.
2022-06-03 14:56:51 +02:00
Thilo Fromm
a9700e16fb ci-automation/tapfile_helper_lib.sh: remove non-printable ASCII
Jenkins TAP file parser does not process non-printable ASCII characters
but bails out. This change removes all ASCII < 0x1F, so non-printable
characters are not included in the TAP report.

Fixes
    Caused by: unacceptable character '' (0x1B) special characters are not allowed
2022-03-16 09:37:48 +01:00
Thilo Fromm
194c503b56
Merge pull request #249 from flatcar-linux/t-lo/ci-automation-tapfile-ascii
ci-automation/tapfile_helper_lib.sh: only ASCII chars
2022-03-10 11:34:04 +01:00
Thilo Fromm
aa6a742efa ci-automation/tapfile_helper_lib.sh: only ASCII chars
This change removes all non-ASCII characters from test debug / error
output when ingesting the output for inclusion in the TAP report.
Jenkins TAP parser does not handle some unicode chars, leading to tap
parser errors with e.g. Cilium output (which uses unicode).

Signed-off-by: Thilo Fromm <thilo@kinvolk.io>
2022-03-10 10:20:11 +01:00
Jeremi Piotrowski
25cf7c4fc5 ci-automation/tapfile_helper_lib: fix commiting last transaction
Move the final db commit to inside the subshell. Since the while loop
runs inside a subshell, the SQL variable outside of the subshell is not
modified, and so the last contents of the SQL variable are dropped. This
shows up when the last couple test cases don't have an error message,
and simply append the transaction to 'SQL'. They are never written to
the db.

Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
2022-03-10 09:14:42 +01:00
Thilo Fromm
eba1cdb4c2 ci-automation/tapfile_helper_lib.sh: fix CI TAP parse errors
This change fixes and adds more string chars escaping in the test error
debug output ("\" are removed and a bug in removing '"' is fixed),
addressing a parser errof the CI encountered when ingesting TAP output.

Furthermore, line numbering is shortened, and test names have a spurious
"-" prefix removed.

Signed-off-by: Thilo Fromm <thilo@kinvolk.io>
2022-03-03 16:29:38 +01:00
Thilo Fromm
2b2bfad5e1 ci-automation/tapfile_helper_lib.sh: use subshell, break lines after 200
Signed-off-by: Thilo Fromm <thilo@kinvolk.io>
2022-03-02 15:35:57 +01:00
Thilo Fromm
22af2876e6 ci-automation/tapfile_helper_lib.sh: read test output from file
This change updates the tapfile helper to read test output from a file
instead of passig it inline in the SQL INSERT statement.
This fixes an issue with large error output from tests, which breaks
tap_ingest_tapfile():
    ci-automation/tapfile_helper_lib.sh: line 31: /usr/bin/sqlite3: Argument list too long
Error observed with the cl.toolbox.dnf-install test, which can generate
8000 lines of output. Fix tested with the same output.

Signed-off-by: Thilo Fromm <thilo@kinvolk.io>
2022-03-02 13:02:52 +01:00
Thilo Fromm
bee5ac7f74 ci-automation/tapfile: enforce foreign keys, simplify 2022-02-21 12:56:45 +01:00
Thilo Fromm
3a416fbf32 ci-automation testing: address PR review comments
- add cleanup script to test.sh
- remove wrapper function from qemu test

Signed-off-by: Thilo Fromm <thilo@kinvolk.io>
2022-02-17 12:30:36 +01:00
Thilo Fromm
6c76bfa1cd
ci-automation/tapfile_helper_lib.sh: add @pothos' retcode fix
Co-authored-by: Kai Lüke <pothos@users.noreply.github.com>
2022-02-17 10:45:10 +01:00
Thilo Fromm
5bfe2f395c
Apply @pothos' suggestions from code review
Co-authored-by: Kai Lüke <pothos@users.noreply.github.com>
2022-02-17 10:29:05 +01:00
Thilo Fromm
f6f44e2ca8 ci-automation: first stab at adding testing
Signed-off-by: Thilo Fromm <thilo@kinvolk.io>
2022-02-16 19:59:45 +01:00