Commit Graph

110 Commits

Author SHA1 Message Date
Kir Kolyshkin d73b4443ef ci: enable -race from matrix
Add a new test matrix dimension so all tests are run twice,
with and without race detector.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2021-02-08 16:01:14 -08:00
Kir Kolyshkin 51ec5db1f1 ci: add i386 unit test run
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2021-02-05 11:54:14 -08:00
Akihiro Suda 9f1e43ea69 Merge pull request #2741 from kolyshkin/test-images 2021-02-05 15:30:43 +09:00
Kir Kolyshkin a9e99b6da3 ci/gha/fedora: retry vagrant up
download.fedoraproject.org gives HTTP 404 at times,
breaking the CI. Let's give it another chance.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2021-02-03 10:56:00 -08:00
Kir Kolyshkin 5ab0588432 ci: untangle getting test images
This simplifies and optimizes getting container images used for tests.

Currently, we have three different ways of getting images:

1. (for hello-world) the image is in this repo under tests/integration/testdata.

2. (for busybox) download it from github (the repo that is used for
   preparing official Docker image) using curl.

3. (for debian) download from Docker hub, using skopeo and umoci.

To further complicate things, we have to do this downloading in multiple
scenarios (at least 4): locally, in github CI, from Dockefile, inside a
Vagrant VM. For each scenario, we have to install skopeo and umoci, and
those two are not yet universally available for all the distros that we
use.

Yet another complication is those images are used for tests/integration
(bats-driven tests) as well as for libcontainer/integration (go tests).
The tests in libcontainer/integration rely on busybox being available
from /busybox, and the bats tests just download the images to a
temporary location during every run.

It is also hard to support CI for other architectures, because all
the machinery for preparing images is so complicated.

This commit is an attempt to simplify and optimize getting images,
mostly by getting rid of skopeo and umoci dependencies, but also
by moving the download logic into one small shell script, which
is used from all the places.

Benefits:

 - images (if not present) are only downloaded once;
 - same images are used for both kind of tests (go and bats);
 - same images are used for local and inside-docker tests
   (because source directory is mounted into container);
 - the download logic is located within 1 simple shell script.

[v2: fix eval; more doc to get-images; print URL if curl failed]
[v3: use "slim" debian, twice as small]
[v4: fix not using $image in setup_bundle]
[v5: don't remove TESTDATA from helpers.bash]
[v6: add i386 support]

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2021-02-02 16:03:29 -08:00
Kir Kolyshkin b1195b7667 ci: test with golang 1.16-rc1
Courtesy of https://github.com/actions/setup-go/issues/92

[v2: update from beta1 to rc1]

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2021-01-28 13:14:34 -08:00
Kir Kolyshkin 8ce51611ce GHA: tune timeouts for VM jobs
The fedora job usually completes within 15-16 minutes,
and the centos-7 one needs 7-8 minutes.

Set the timeouts to twice those values.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2021-01-16 00:41:27 -08:00
Kir Kolyshkin a91210f499 gha: use ssh -tt to have a tty
Github Actions execution environments lack tty, which is needed for
integration tests. We have used script utility before to provide a fake
tty, but it appears to be buggy on CentOS 7.

Since we use ssh anyway to access Vagant VM, add -tt to forcefully
allocate a tty.

Apparently, neither "TERM=xterm" nor "stty size" is needed for
any tests to work, so remove those, too.

Finally, unit tests do not need a terminal, so remove the "script"
from those.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2021-01-16 00:40:44 -08:00
Kir Kolyshkin 2dc1bf91a4 ci: move Fedora 33 and CentOS 7 tests to gha
...and remove .travis.yml as GHA now covers everything it used to
(unless I overlooked something).

Inspired by https://github.com/containerd/containerd/pull/4279

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2021-01-05 21:03:12 -08:00
Kir Kolyshkin c1ef0cf62c ci: add integration+unit tests to github actions
This is Ubuntu 20.04 so cgroup v1 testing only :(
The upside is, it's pretty fast (currently all the tests finish
within 5 minutes).

rootless tests take longer time so we run them in parallel
with non-rootless ones. Also, to balance the time, we run
unit tests when rootless is not set. IOW, 'rootless' in job
name means it's only rootless integration tests, and no rootless
means it's unit tests, integration tests with fs driver, and
integration tests with systemd driver.

Note, `script` is used to run integration tests to provide a tty
(which by default is not available on gh actions).

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2020-11-27 21:35:02 -08:00