]> git.ipfire.org Git - thirdparty/haproxy.git/commit
SCRIPTS: run-regtests: add a version check
authorWilly Tarreau <w@1wt.eu>
Wed, 30 Nov 2022 17:44:33 +0000 (18:44 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 30 Nov 2022 17:44:33 +0000 (18:44 +0100)
commit9d5e11682cd48ba93195b9cd7797d22c9f518247
tree389243c39424750b5ed7151739c2568dda36355f
parent111c78329e89965115f014b043a9695dc9a0bebd
SCRIPTS: run-regtests: add a version check

It happens from time to time while switching between branches and/or
updating after someone else's changes that regtests are run by accident
on the wrong binary, typically the one the tests were run on during
development and not with the latest adaptations. And obviously it's
when this happens that we break the CI. There are various causes to
this but they all come down to humans context-switching a lot, and
there's no real fix for this that doesn't add even more burden hence
increases the overhead. However we can help the human detect such
mistakes very easily.

This change here will compare the version of the haproxy binary to
the version of the tree, and will emit a warning in the regtest output
if they do not match, regardless of the outcome of the test. This is
sufficient in case of failures because these are quickly glanced over,
and is sufficient as well in case of accidental success because the
warning is the last message. E.g:

  ########################## Starting vtest ##########################
  Testing with haproxy version: 2.7-dev10-cfcdbc-38
  Warning: version does not match the current tree (2.7-dev10-111c78-39)
  0 tests failed, 0 tests skipped, 182 tests passed

This should not affect builds made out of a git tree because the version
is retrieved using "make version", or exactly the same way as it's passd
to the haproxy binary. We just need to know what "make" command to run,
so $MAKE is used primarily, falling back to "make" then to "gmake". In
case all of these fail, we just ignore the version check. This should be
sufficient to catch human mistakes without affecting the CI.
scripts/run-regtests.sh