Skip to content

hack/ci: fix log summary for non-int ginkgo suites - #29535

Open
Bhuvanesh66 wants to merge 1 commit into
podman-container-tools:mainfrom
Bhuvanesh66:fix/ci-log-summary-ginkgo-detection
Open

hack/ci: fix log summary for non-int ginkgo suites#29535
Bhuvanesh66 wants to merge 1 commit into
podman-container-tools:mainfrom
Bhuvanesh66:fix/ci-log-summary-ginkgo-detection

Conversation

@Bhuvanesh66

@Bhuvanesh66 Bhuvanesh66 commented Aug 15, 2026

Copy link
Copy Markdown

Checklist

Ensure you have completed the following checklist for your pull request to be reviewed:

  • I have read and understood our contributing guidelines and will not have more than two open PRs as a new contributor.
  • PR description, commit message, and GitHub comments are human-written, per LLM Policy
  • Certify you wrote the patch or otherwise have the right to pass it on as an open-source patch by signing all commits. (git commit -s).
  • Referenced issues using Fixes: #00000 in commit message (if applicable)
  • Tests have been added/updated (or no tests are needed)
  • Documentation has been updated (or no documentation changes are needed)
  • All commits pass make validatepr (format/lint checks)
  • Release note entered in the section below (or None if no user-facing changes)

github_log_summary.py decided whether a log was ginkgo or bats by looking at the
file name — if 'int-' in file_path. logformatter decides from the log contents
instead, so the two disagree for any ginkgo suite whose TEST_NAME does not begin
with int.

The bindings suite is one of those. It is ginkgo, it runs in the small-tests
matrix, and run_bindings pipes it through logformatter. Feeding one and the same
ginkgo log through the summary under two names:

file name summary output
int-local-root-fedora-current.log.html full failure block — test name, source location, timeline
bindings-root-fedora-current.log.html 1 Failed

So when bindings fails, the "Output failure log as GITHUB_STEP_SUMMARY" step prints a
bare count and nothing else, at the one moment the summary is meant to be useful.

Detect the format from the content instead. The log-failed class is only emitted on
the ginkgo path; the logrus handler emits log levels, so it can never produce
failed.

Two smaller things in the same file:

  • The script only summarized sys.argv[1], while the workflow passes a glob. Each job
    writes one html file today, so nothing is lost in practice, but any further file was
    silently dropped. It now walks every argument.
  • The entry point is guarded on __main__, which is what makes the script importable
    and therefore testable.

Added hack/ci/github_log_summary.t, the first test for this script, run from
.check-self-tests alongside logformatter.t. It covers ginkgo detection for both
int- and non-int- names, bats logs, and a ginkgo log with no failures. Reverting
only the detection line fails exactly one of the four, so it does discriminate.

One note on CI: pr-should-include-tests looks for changes under test/ or in
*_test.go, and hack/ self-tests are neither, so the check will fail here even
though this adds a test. It will need the No New Tests label.

Does this PR introduce a user-facing change?

None

github_log_summary.py chose its parser from the file name, treating a
log as ginkgo only when the path contained "int-". logformatter picks
its markup from the log contents instead, so any ginkgo suite whose
TEST_NAME does not begin with "int" was parsed by the bats parser.

The bindings suite is one of those: it is ginkgo, it runs in the
small-tests matrix, and its output is piped through logformatter. Given
one and the same ginkgo log, int-local-root-fedora.log.html yields the
full failure block while bindings-root-fedora.log.html yields only
"1 Failed". A failing bindings run therefore leaves the GitHub step
summary with nothing useful in it, which is the one moment the summary
exists for.

Detect the format from the content, the way logformatter does. The
"log-failed" class is only ever emitted on the ginkgo path; the logrus
handler emits log levels, never "failed".

Summarize every file named on the command line as well, instead of only
the first one. The workflow passes a glob, and although each job writes
a single html file today, any further files were silently dropped.

Add hack/ci/github_log_summary.t, the first test for this script, and
run it from .check-self-tests. Guarding the entry point on __main__ is
what lets the test import the script at all.

Signed-off-by: Bhuvanesh66 <bhuvaneshms60@gmail.com>
@github-actions github-actions Bot added the CI label Aug 15, 2026

@Honny1 Honny1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

PTAL @podman-container-tools/podman-maintainers @podman-container-tools/podman-reviewers

@Bhuvanesh66

Copy link
Copy Markdown
Author

Thanks for the review. The three failing checks look unrelated to this change.

farm rootless fedora-current failed during setup, before any test ran: chown: cannot access '/dev/kvm': No such file or directory — the runner had no KVM device.

macos machine applehv failed one spec out of 78, podman machine ssh [It] verify machine rootfulness, where podman machine init --now timed out after 600s. 77 passed.

Total Success is the aggregate of those two.

This PR only touches hack/ci/github_log_summary.py, its new test, and one line in the Makefile, and the script runs solely in the if: failure() summary step of lima.yml. Could someone re-run the failed jobs?

Separately — that failed run surfaced a small pre-existing wart: when a job fails before any log is written, the glob doesn't expand and the script tracebacks on the literal path. || true hides it, and it behaves identically on main. Happy to send that as a follow-up PR rather than widen this one.

@danishprakash danishprakash left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 to content-based matching over filename-based, the latter depends on someone making sure any new suite/variant is manually covered in the script.

I have a few comments on the markers primarily and another test-related nit.


Also, please read our AI Policy if you haven't yet.

# Detect the format the same way, so that ginkgo suites which are not named
# "int-" (the bindings suite, for example) are parsed as ginkgo rather than
# falling through to the bats parser.
GINKGO_MARKER = 'class="log-failed"'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you test this? the logformatter script implies that log-failed won't be emitted if tests are not run with -p.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on an unrelated note: it seems that the bindings test that run without -p currently are classed as log-passed and though I guessed why that happens (ginkgo printing the status at the end instead of the beginning). I was thinking of sending in a patch for this in logformatter but it seems this must've been caught before, thoughts? @Luap99

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have never looked deeply into the logformatter logic, I do not understand most of the perl script there.
The bindings tests fail rarely so I never looked really closely there

And yes it would be nice to test this by pushing a error into the bindings test and verify the the summary work asnd have an actual test content based on real bindings output

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed @Luap99 , a fixture built from real output is the right bar. What's on the branch now is hand-written and I can't honestly claim it matches what bindings actually produces.

Plan:
Push a deliberate failure into one of the pkg/bindings/test specs, let CI produce a real failing log, check the summary against that, and build the test fixture from the artifact. Then revert the deliberate failure.

On why this wasn't caught before — I think the log-* classes were only ever read by humans until github_log_summary.py started depending on them in June. Reading the HTML you see the red [FAILED] text in the block and don't notice the heading above it is green, so there was nothing to notice until something parsed them.

@danishprakash you mentioned maybe sending a logformatter patch — do you want to take that, or should I fold it into this PR? I have one working locally but don't want to duplicate your work.

Comment on lines +58 to +67
def test_ginkgo_suite_not_named_int(self):
"""Ginkgo suites are detected by content, not by the file name.

The bindings suite is ginkgo but is not called "int-". Keying off the
name meant its failures were parsed with the bats parser, which found
no bats markup and so reported nothing useful.
"""
out = "".join(summarize(GINKGO_HTML, "bindings-root-fedora.log.html"))
self.assertIn("[FAILED] podman pod correctly sets up PIDNS", out)
self.assertIn("expected exit code 0, got 125", out)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we're now using content instead of the filename, this test is the same as the one before

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah you are right it is redundant and the bigger gap is that all my ginkgo fixtures are -p-shaped so no one could catch this so i will sort it out when i rebuild then from real ouput

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants