summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/cirrus/logformatter19
-rwxr-xr-xcontrib/cirrus/logformatter.t6
-rwxr-xr-xcontrib/cirrus/runner.sh19
-rwxr-xr-xcontrib/cirrus/setup_environment.sh18
4 files changed, 47 insertions, 15 deletions
diff --git a/contrib/cirrus/logformatter b/contrib/cirrus/logformatter
index 43173eaa6..5b8e2f2a1 100755
--- a/contrib/cirrus/logformatter
+++ b/contrib/cirrus/logformatter
@@ -307,10 +307,18 @@ END_HTML
elsif ($line =~ /^#\s#\|\s/) { $css = 'log-esm' }
elsif ($line =~ /^#\s/) { $css = 'log' }
+ # Link to source file. This is ugly: we have to hardcode 'podman'
+ # and 'test/system' because there's no way to get them from log.
+ #
+ # 1 2 2 13 4 43 5
+ $line =~ s{(in(\stest)?\s+file\s+\S+/)(\S+\.(bats|bash)),\s+line\s+(\d+)}{$1<a class="codelink" href="https://github.com/containers/podman/blob/$git_commit/test/system/$3#L$5">$3, line $5</a>};
+
if ($css) {
# Make it linkable, e.g. foo.html#t--00001
- if ($line =~ /^(not\s+)?ok\s+(\d+)/) {
+ if ($line =~ /^(not\s+)?ok\s+(\d+)\s+(.*)/) {
$line = sprintf("<a name='t--%05d'>%s</a>", $2, $line);
+
+ push @{$bats_count{__fail_list}}, [ $2, $3 ] if $1;
}
$line = "<span class='bats-$css'>$line</span>";
@@ -515,6 +523,15 @@ END_HTML
}
}
+ # Grumble. Github only shows the last N lines of the log... which is
+ # anti-helpful when you want a quick synopsis of what failed. Write a
+ # summary at the tail, to make it easier for humans to see what went wrong.
+ if (my $fails = $bats_count{__fail_list}) {
+ print "\n";
+ printf "Failed tests (%d):\n", scalar(@$fails);
+ printf " - %d %s\n", @$_ for @$fails;
+ }
+
# If Cirrus magic envariables are available, write a link to results.
# FIXME: it'd be so nice to make this a clickable live link.
#
diff --git a/contrib/cirrus/logformatter.t b/contrib/cirrus/logformatter.t
index df8154cb9..7f5973a15 100755
--- a/contrib/cirrus/logformatter.t
+++ b/contrib/cirrus/logformatter.t
@@ -91,6 +91,9 @@ __END__
ok 1 hi
ok 2 bye # skip no reason
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 foo -bar
# #| FAIL: exit code is 123; expected 321
ok 4 blah
@@ -99,6 +102,9 @@ ok 4 blah
<span class='bats-passed'><a name='t--00001'>ok 1 hi</a></span>
<span class='bats-skipped'><a name='t--00002'>ok 2 bye # skip no reason</a></span>
<span class='bats-failed'><a name='t--00003'>not ok 3 fail</a></span>
+<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">podman</span> foo -bar</b></span>
<span class='bats-log-esm'># #| FAIL: exit code is 123; expected 321</span>
<span class='bats-passed'><a name='t--00004'>ok 4 blah</a></span>
diff --git a/contrib/cirrus/runner.sh b/contrib/cirrus/runner.sh
index 3aa69183e..1bff07203 100755
--- a/contrib/cirrus/runner.sh
+++ b/contrib/cirrus/runner.sh
@@ -55,17 +55,18 @@ function _run_unit() {
}
function _run_apiv2() {
- local m="Testing of API was performed using the **PODMAN*** client"
- warn "$m"
- if ! make localapiv2 |& logformatter; then
- die "$m"
- fi
+ source .venv/requests/bin/activate
+ make localapiv2 |& logformatter
}
function _run_compose() {
./test/compose/test-compose |& logformatter
}
+function _run_compose_v2() {
+ ./test/compose/test-compose |& logformatter
+}
+
function _run_int() {
dotest integration
}
@@ -100,12 +101,8 @@ function _run_bindings() {
}
function _run_docker-py() {
- m="Testing of API was performed using the **DOCKER** client"
- warn "$m"
- source venv/bin/activate
- if ! make run-docker-py-tests; then
- die "$m"
- fi
+ source .venv/docker-py/bin/activate
+ make run-docker-py-tests
}
function _run_endpoint() {
diff --git a/contrib/cirrus/setup_environment.sh b/contrib/cirrus/setup_environment.sh
index 93f085983..864c78484 100755
--- a/contrib/cirrus/setup_environment.sh
+++ b/contrib/cirrus/setup_environment.sh
@@ -265,14 +265,26 @@ case "$TEST_FLAVOR" in
msg "Installing previously downloaded/cached packages"
dnf install -y $PACKAGE_DOWNLOAD_DIR/python3*.rpm
- virtualenv venv
- source venv/bin/activate
+ virtualenv .venv/docker-py
+ source .venv/docker-py/bin/activate
pip install --upgrade pip
pip install --requirement $GOSRC/test/python/requirements.txt
;;
build) make clean ;;
unit) ;;
- apiv2) ;& # use next item
+ compose_v2)
+ dnf -y remove docker-compose
+ curl -SL https://github.com/docker/compose/releases/download/v2.2.3/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose
+ chmod +x /usr/local/bin/docker-compose
+ ;& # Continue with next item
+ apiv2)
+ msg "Installing previously downloaded/cached packages"
+ dnf install -y $PACKAGE_DOWNLOAD_DIR/python3*.rpm
+ virtualenv .venv/requests
+ source .venv/requests/bin/activate
+ pip install --upgrade pip
+ pip install --requirement $GOSRC/test/apiv2/python/requirements.txt
+ ;& # continue with next item
compose)
rpm -ivh $PACKAGE_DOWNLOAD_DIR/podman-docker*
;& # continue with next item