Skip to content

Commit

Permalink
logformatter: strip "--url xxx" from bats podman-remote
Browse files Browse the repository at this point in the history
...it's useless clutter.

Signed-off-by: Ed Santiago <[email protected]>
  • Loading branch information
edsantiago committed Aug 19, 2024
1 parent 24235df commit 82e701a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 4 additions & 3 deletions contrib/cirrus/logformatter
Original file line number Diff line number Diff line change
Expand Up @@ -426,9 +426,10 @@ END_HTML
}

# Readability: /long/path/to/podman -> podman (hover for full path)
# Also make it boldface, to make commands stand out
$line =~ s{^(#\s+(#|\$)\s+)(\S+/)(podman\S*)(\s.*)}
{$1<b><span title="$3$4">$4</span>$5</b>};
# Also make it boldface, to make commands stand out, and strip --url
# 1 2 2 13 345 56 6 47 7
$line =~ s{^(#\s+(#|\$)\s+)(\S+/)((podman\S*)(\s+--url\s+\S+)?)(\s.*)}
{$1<b><span title="$3$4">$5</span>$7</b>};

if ($line =~ /^ok\s.*\s# skip/) { $css = 'skipped' }
elsif ($line =~ /^ok\s/) { $css = 'passed' }
Expand Down
2 changes: 2 additions & 0 deletions contrib/cirrus/logformatter.t
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ not ok 3 fail
# (from function `assert' in file ./helpers.bash, line 343,
# from function `expect_output' in file ./helpers.bash, line 370,
# in test file ./run.bats, line 786)
# $ /path/to/podman-remote --url /this/should/be-stripped blah blah
# $ /path/to/podman foo -bar
# time="2023-01-05T15:15:20Z" level=debug msg="this is debug"
# time="2023-01-05T15:15:20Z" level=warning msg="this is warning"
Expand All @@ -109,6 +110,7 @@ ok 4 blah
<span class='bats-log'># (from function `assert&#39; in file ./<a class="codelink" href="https://github.com/containers/podman/blob/ceci-nest-pas-une-sha/test/system/helpers.bash#L343">helpers.bash, line 343</a>,</span>
<span class='bats-log'># from function `expect_output&#39; in file ./<a class="codelink" href="https://github.com/containers/podman/blob/ceci-nest-pas-une-sha/test/system/helpers.bash#L370">helpers.bash, line 370</a>,</span>
<span class='bats-log'># in test file ./<a class="codelink" href="https://github.com/containers/podman/blob/ceci-nest-pas-une-sha/test/system/run.bats#L786">run.bats, line 786</a>)</span>
<span class='bats-log'># $ <b><span title="/path/to/podman-remote --url /this/should/be-stripped">podman-remote</span> blah blah</b></span>
<span class='bats-log'># $ <b><span title="/path/to/podman">podman</span> foo -bar</b></span>
<span class='bats-log'># time=<span class='log-debug'>&quot;2023-01-05T15:15:20Z&quot;</span> level=<span class='log-debug'>debug</span> msg=<span class='log-debug'>&quot;this is debug&quot;</span></span>
<span class='bats-log'># time=<span class='log-warning'>&quot;2023-01-05T15:15:20Z&quot;</span> level=<span class='log-warning'>warning</span> msg=<span class='log-warning'>&quot;this is warning&quot;</span></span>
Expand Down

0 comments on commit 82e701a

Please sign in to comment.