]> git.ipfire.org Git - thirdparty/squid.git/commit
Start using Github Actions for CI tests (#1160)
authorAlex Rousskov <rousskov@measurement-factory.com>
Mon, 10 Oct 2022 04:24:22 +0000 (04:24 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Mon, 10 Oct 2022 15:24:11 +0000 (15:24 +0000)
commit2ed8cc427fff8ee6d475d66a42a38faf9e9e7468
treeb725d368fe762c5bdd235d1e2fb988e728fd76e4
parentc46e7febd8aa9aa87c7ed129242175c1b3ec149c
Start using Github Actions for CI tests (#1160)

This change imports existing Sempaphore CI functionality test harness
and migrates it to Github Actions. Using a stand-alone harness offered
many advantages, but that approach goes against the current custom of
importing CI configurations into being-tested repositories. Semaphore CI
itself switched to such invasive configurations since v2. We have to
start using invasive CI configurations to be able to evolve Squid CI and
solve known CI problems.

While importing the test harness, we made basic CI functionality tests
available from the command line so that developers can run them even
before submitting a PR and while addressing reviewer concerns. They do
require internet access because the tests are downloaded from GitHub,
but they avoid permanent service installations in developer environment.
The tests do create/overwrite logs and start services like Squid. A lot
more work is still required to make these tests user friendly.

The new test configuration/harness consists of two primary parts:

* Github Actions "workflow" configuration, including embedded scripts.
* Various test scripts used by the "workflow" configuration above.

There are many ways to split the test harness among those two parts.
This particular split is based on these split-specific principles/ideas:

1. When running tests locally, developers do not want to risk
   disruptive, permanent, potentially dangerous actions such as globally
   installing new packages or overwriting checked out Squid sources.
   These actions belong to the workflow configuration file that is only
   interpreted by Github Actions, on Github virtual machines. The test
   scripts have only one sudo command (to start a Squid manipulating
   agent as nobody) which is bypassed of the agent is already running.

2. Developers should be able to repeat basic tests from the command
   line, against their version of Squid sources, their Squid builds, and
   without learning the ever-changing testing details. If their PR has
   failed a CI test, they may simple want to run the corresponding
   script locally to reproduce the issue. This means that nearly all
   testing logic belongs to the test scripts, not the Actions
   configuration file (that developers cannot easily interpret/apply).

We also thought that some developers would want to separate
functionality from code quality tests (because those are often applied
at different development stages) and to repeat (many times) just the
failed test case (because that often helps when triaging and fixing
bugs). These considerations resulted in the creation of two scripts,
each accepting individual test case names as optional parameters:

* test-suite/test-functionality.sh
* test-suite/test-sources.sh
.github/workflows/default.yaml [new file with mode: 0644]
test-suite/Makefile.am
test-suite/test-functionality.sh [new file with mode: 0755]
test-suite/test-sources.sh [new file with mode: 0755]