Skip to content

Improve reports - #15

Open
rosemarie-o wants to merge 10 commits into
fuzzfactor:mainfrom
rosemarie-o:reports-max-log-lines
Open

rosemarie-o wants to merge 10 commits into
fuzzfactor:mainfrom
rosemarie-o:reports-max-log-lines

Conversation

@rosemarie-o

Copy link
Copy Markdown
  • Report limits. Reports are cut per test, per job and in total, and a note says how much was left out. The new options are report.max_log_jobs, max_listed_tests, max_tests, max_test_lines, log_lines and max_lines. There's also a fixed cap of 20000 characters. Every option has a default and is explained in detail in examples/reference.yaml.
  • Apply failures show the conflicts. git am now runs without -q and with its hints turned off. Its output names the files with conflicts, and the diff of the conflicts follows it, ignoring the operator's color and diff settings. These reports are cut by report.max_lines, which replaces the old hardcoded caps. Fixes In Apply reports, show conflicts #2.
  • checkpatch errors. Jobs with error annotations (like checkpatch) report those messages instead of the end of their log.
  • Log format per workflow. The new report.workflow_logs_format option maps a workflow to a test log format. Unknown format names are rejected. Workflows not listed keep the old behavior, and an empty map turns the feature off.
  • Failed tests listed and shown. For workflows with a format, each job lists its failed test names, followed by the log of each failed test (whole tests only, within the limits). Fixes In Build and Test report, show test failures rather than last 25 lines #1.
  • Better fallback. When no tests are found (for example, the build failed before the tests ran), the report shows the last lines before the failed step ended, not the cleanup steps after it.
  • Ginkgo format (ginkgo). For ovn-kubernetes, failed specs come from Ginkgo's "Summarizing N Failures" block. Each spec's log is its failure block, and long logs keep their beginning.
  • Autotest format (autotest). For OVN "Build and Test", failed tests come from every "Summary of the failures" section in the job, including rechecks. Each test's log comes from "Detailed failed tests", and long logs keep their end.
  • Each test's log shown once. When a test fails in several jobs, its log appears only once per report. This is a separate commit that nothing else depends on, so it's easy to revert.

Reports of failed runs included the last log_lines lines of up to
max_log_jobs failed jobs.  Add limits at each level: max_test_lines
for the log of each failed test, max_job_lines for everything shown
for a job, and max_lines for the whole report, which is also cut
after 20000 characters in case of very long lines.  A job without
failed tests still shows the last log_lines lines of its log.  Text
over a limit is cut after its first lines, with a note of how many
lines were left out, and the report goes on with the next test or job
until it shows max_log_jobs jobs or the whole report is full.

Failed tests come from testParsers, which has none yet.

Signed-off-by: Rosemarie O'Riorden <rosemarie@redhat.com>
git am -q prints only "Patch failed at ..." and hints, so reports of
patches that fail to apply did not say where the conflict was.  Run git
am without -q, which names every file with conflicts, turn off its hints,
and follow its output with the diff of the conflicts.  The diff ignores
the color and external diff settings of the user running the robot,
which would garble the report.  The report is cut like the logs of
failed runs, after report.max_lines lines and 20000 characters, instead
of after its last 4000 characters.

Fixes fuzzfactor#2

Signed-off-by: Rosemarie O'Riorden <rosemarie@redhat.com>
The report of a failed job carried the last 25 lines of its log, which
for checkpatch were mostly the source of the step, its environment and
the cleanup of the runner, with the color codes of GitHub, around the
few lines checkpatch printed.

Like warnings, the checkpatch workflows now put the output of
checkpatch in an error annotation titled workflows.warning_annotation
when it fails, and the report carries the messages of such annotations
instead of the log.  Jobs without them, or whose annotations cannot be
read for lack of permission, are still reported with their log.

The messages of error annotations are cut with the rest of the report,
to report.max_lines lines and 20000 characters.  Warnings are now cut
the same way; they were cut to report.log_lines lines, which could drop
some of the output of checkpatch.

Fixes fuzzfactor#7

Signed-off-by: Rosemarie O'Riorden <rosemarie@redhat.com>
Failed tests used to be looked for in every job log with every parser,
so a workflow could match a format by accident.  The new option
report.workflow_logs_format maps workflow names to the format of their
logs instead.  The jobs of other workflows, and jobs whose log has no
failed tests in its format, still get the last log_lines lines of their
log, so leaving the option empty keeps the old reports.

No format exists yet, so any format name is rejected for now.

Signed-off-by: Rosemarie O'Riorden <rosemarie@redhat.com>
The names of the failed tests are the most useful part of a report, so
each job with failed tests now starts with a list of them, before their
logs.  The list is cut after report.max_listed_tests names and does not
count towards max_job_lines, which now only limits the logs of the
tests.

Signed-off-by: Rosemarie O'Riorden <rosemarie@redhat.com>
max_job_lines cut the logs of a job in the middle of a test, and its
value had to be kept in line with max_test_lines.  It is replaced by
max_tests: each job shows the logs of up to that many tests, each cut
only by max_test_lines, and a note says how many more failed.  A job
thus shows at most max_tests x max_test_lines log lines.  The fallback
tail is limited by log_lines alone.

max_log_jobs now defaults to 3, so that 3 jobs of 4 tests of 25 log
lines match the default max_lines of 300.  max_lines stays a ceiling
that counts every line of the report, so it only cuts reports with
many failures.  The example config explains in detail how the limits
work together.

Signed-off-by: Rosemarie O'Riorden <rosemarie@redhat.com>
When no failed tests are found in a job log, the report shows its last
log_lines lines.  But the steps that run after a failed step, like
uploading artifacts and cleaning up the checkout, push the error out of
those lines.  The job of an ovn-kubernetes run that failed to download
its Go modules showed only git cleanup.

Cut each job log at the "##[error]Process completed with exit code"
line that ends the failed step, or the "##[error]The operation was
canceled" line of a timeout, and show the lines up to it.  That line
stays in the report, since it gives the exit code of the step.  The
log parsers get the cut log too, so they do not look at the cleanup.

logTail now reads its lines from the end of the log instead of
splitting the whole log, and also removes color codes.

Signed-off-by: Rosemarie O'Riorden <rosemarie@redhat.com>
The e2e jobs of ovn-kubernetes run a Ginkgo test suite.  Reports of
failed runs only showed the last lines of their logs, which say nothing
about which specs failed.

Add the "ginkgo" log format.  Ginkgo lists the failed specs in a
"Summarizing N Failures:" block at the end of the suite, and earlier,
when each spec failed, prints a report with its error.  The report has
the same name line as the summary, color codes and all, so it is found
by searching back for that line in the raw log.  Only the summary and
the reports are split into lines and cleaned, not the whole log, which
can be 30000 lines.

Searching the whole log for "[FAILED]" would not work: Ginkgo prints it
for retried specs that passed in the end and for each failed step.

Use the format for the ovn-kubernetes workflow in the OVN example.

Signed-off-by: Rosemarie O'Riorden <rosemarie@redhat.com>
The "Build and Test" jobs of OVN run "make check", an Autotest test
suite, and print tests/testsuite.log when tests fail.  Reports of
failed runs only showed the last lines of their logs, after all of
that.

Add the "autotest" log format.  The failed tests are those listed in
each "Summary of the failures" of the log, as failed tests or unexpected
passes.  A job can run several test suites, like OVN running its
unstable tests after the others, so every summary is read and the tests
of all of them are listed, each once.  The log of each test is its part
of the "Detailed failed tests" that follow the summary.  The summaries
are found with a plain search, and only they and the details are split
into lines.

The check that failed and its output are at the end of a test's log, so
add a Tail flag to failed tests to keep the last max_test_lines lines
of a long log instead of the first ones.  The note on how many lines
were left out then goes first.

Use the format for "Build and Test" in the OVN example.  The OVS jobs
do not print testsuite.log, so they keep showing the last log lines.

Signed-off-by: Rosemarie O'Riorden <rosemarie@redhat.com>
The same test often fails in several jobs of a matrix, with much the
same log each time.  Show its log in the first job only.  Later jobs
still list its name among their failed tests and say that its log is
skipped, which leaves room for the logs of other tests.

Signed-off-by: Rosemarie O'Riorden <rosemarie@redhat.com>
@rosemarie-o
rosemarie-o force-pushed the reports-max-log-lines branch from ce1ad2a to 848d93e Compare November 30, 2026 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

In Apply reports, show conflicts In Build and Test report, show test failures rather than last 25 lines

1 participant