Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI:DOCS] logformatter: handle python logs #13241

Merged

Conversation

edsantiago
Copy link
Member

We've got some python tests running in CI, and they're really hard
to troubleshoot. This PR:

  1. colorizes python unittest lines (ok / skipped / fail), and
  2. links to source files

The color is nice for skimming, but it's the linking that might
make it much easier to diagnose future failures.

(Context: failure today in test/python/docker/compat/test_images.py)

Signed-off-by: Ed Santiago [email protected]

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 15, 2022
@edsantiago
Copy link
Member Author

edsantiago commented Feb 15, 2022

Sample log, based on the PR that failed earlier today. (Compare to the original). The "WARNING: Expected NNN" at bottom, there's not much I can do about it: it's caused by python tests whose line does not end in dot-dot-dot-space-ok because they have spurious other output.

We've got some python tests running in CI, and they're really hard
to troubleshoot. This PR:

  1) colorizes python unittest lines (ok / skipped / fail), and
  2) links to source files

The color is nice for skimming, but it's the linking that might
make it much easier to diagnose future failures.

(Context: failure today in test/python/docker/compat/test_images.py)

Signed-off-by: Ed Santiago <[email protected]>
@edsantiago edsantiago force-pushed the logformatter_do_python branch from 6aa295b to 7a83d16 Compare February 16, 2022 13:31
@mheon
Copy link
Member

mheon commented Feb 16, 2022

@edsantiago Should we just split them into a separate Cirrus test run? Might make your life easier with the logformatter and completely eliminates the chance of confusion like yesterday.

Copy link
Member

@cevich cevich left a comment

Choose a reason for hiding this comment

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

LGTM

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 16, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cevich, edsantiago

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@cevich
Copy link
Member

cevich commented Feb 16, 2022

Re: Splitting them up. Possible to do, but will need some twiddling with .cirrus.yml and likely runner.sh as well. It could be done via a dedicated (new) task (harder), or in the same task (easier) as an additional script (similar to how we have a separate "setup" section and "main" sections). For example, one idea might be:

foo_bar_task:
    ...cut...
    env:
        TEST_FLAVOR=foobar
    setup_script: *setup
    main_script: *main
    extra_script: 'env TEST_FLAVOR=${TEST_FLAVOR}2 $GOSRC/$SCRIPT_BASE/runner.sh'
    always: *runner_stats

Wherein, the runner function _run_foobar2() performs the second section of the test. In this example, the extra_script attribute will cause a distinct and separate execution (named "extra") to happen after main_script causes _run_foobar() to run (and it passes). Obviously, you could easily use a more descriptive name than "extra" if you prefer 😄

@edsantiago
Copy link
Member Author

Re: splitting up: whether or not that's done, this PR still seems useful: the python tests will be run regardless, and ISTM useful to have a one-click way to get to the source code.

@cevich I believe the context here is that the tests are running twice already. When looking at the CI failures in #13239, there were two CI jobs that had exactly the same python failure: APIv2 tests and something else. From a quick look-see (I'm on PTO today) it looks like make localapiv2 and make run-docker-py-tests both invoke python on test/python/docker; the duplication seems unnecessary.

@Luap99
Copy link
Member

Luap99 commented Feb 17, 2022

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Feb 17, 2022
@openshift-merge-robot openshift-merge-robot merged commit a429dcd into containers:main Feb 17, 2022
@cevich
Copy link
Member

cevich commented Feb 17, 2022

the duplication seems unnecessary.

Oh! Okay, that sounds like an easily corrected oversight. I'll open an issue. Thanks.

@cevich
Copy link
Member

cevich commented Feb 17, 2022

Ref: #13273

@edsantiago edsantiago deleted the logformatter_do_python branch February 19, 2022 23:10
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 21, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants