zephyrproject-rtos / ci-tools

CI Tools and Scripts (obsolete)
Apache License 2.0
9 stars 18 forks source link

check_compliance.py: Always show warnings from checkpatch.pl #96

Closed ulfalizer closed 5 years ago

ulfalizer commented 5 years ago

First commit adds support for informational messages from tests. Second commit uses it to report warnings from the CheckPatch test, even when there are no errors that would fail the test.

check_compliance.py: Add support for informational messages

Add a new ComplianceTest.add_info() function for showing informational
messages in tests without failing the test. Informational messages are
always shown on GitHub, regardless of whether the test succeeds or not.

CI runs check_compliance.py several times and keeps track of test
results by saving them to JUnit XML files that later get loaded, which
complicates things. To preserve informational messages, save them in a
new 'info_msg' attribute on <testcase> (added via the custom MyCase
class).

Piggyback removal of a declared-but-unused (never set) 'doc' attribute
on <testcase>, and some minor EDIT_TIP cleanup (add it in
github_comment(), since it should always appear).
check_compliance.py: Always show warnings from checkpatch.pl

Always show the output from checkpatch.pl on GitHub, even if there are
no errors. This way, warnings will always be seen.

checkpatch.pl produces no output if there are neither warnings nor
errors (because of --mailback), so this won't cause GitHub spam.

Fixes: #63
marc-hb commented 5 years ago

Nice! The code looks pretty straight-forward. Would it be possible to see a "demo" somewhere?

zephyrbot commented 5 years ago

All checks are passing now.

License (informational only, not a failure)

Hello there, @marc-hb
ulfalizer commented 5 years ago

@marc-hb See above for demo. I was hoping to have it failure-free too, but I messed up.~

Edit: Now passing.

Edit: Will trick the bot into posting a success-right-away message too (by removing EDIT_TIP from the message)

zephyrbot commented 5 years ago

All checks are passing now.

License (informational only, not a failure)

Hello there, @marc-hb
ulfalizer commented 5 years ago

Hmm... the behavior is slightly wonky when there's an immediate success along with an informational message though. Get a All checks passed that then gets edited to All checks are passing now.

It's due to check_compliance.py being run twice by the ci-pipelines repo (once for everything-but-documentation, and then for documentation, with saving tests in-between). Second pass now sees the message that was posted by the first pass, assumes it's a failure message, and edits it.

Think I could work around it... w8.

zephyrbot commented 5 years ago

All checks passed.

Tip: The bot edits this comment instead of posting a new one, so you can check the comment's history to see earlier messages.

ulfalizer commented 5 years ago

Seems to be working now. That message thing gets a bit confusing.