Skip to content
Snippets Groups Projects
Verified Commit 06acda21 authored by Jelle van der Waa's avatar Jelle van der Waa :construction:
Browse files

Run tests with podman in CI

This makes it possible to run the tests with podman which has the
benefit of requiring no daemon.
parent a7e6edb2
No related branches found
No related tags found
No related merge requests found
......@@ -3,8 +3,7 @@ image: "archlinux:latest"
test:
script:
- pacman -Syu --needed --noconfirm docker make
- systemctl start docker
- make test-coverage
- pacman -Syu --needed --noconfirm podman make
- make test DOCKER=podman
tags:
- vm
IMAGE:=dbscripts/test
RUN_OPTIONS:=--rm --network=none -v $(PWD):/dbscripts:ro --tmpfs=/tmp:exec -w /dbscripts/test
CASES ?= cases
DOCKER ?= docker
test-image:
docker build --pull -t $(IMAGE) test
$(DOCKER) build --pull -t $(IMAGE) test
test: test-image
docker run $(RUN_OPTIONS) $(IMAGE) make CASES=$(CASES) test
$(DOCKER) run $(RUN_OPTIONS) $(IMAGE) make CASES=$(CASES) test
test-coverage: test-image
rm -rf ${PWD}/coverage
mkdir -m 777 ${PWD}/coverage
docker run $(RUN_OPTIONS) -v ${PWD}/coverage:/coverage -e COVERAGE_DIR=/coverage $(IMAGE) make test-coverage
$(DOCKER) run $(RUN_OPTIONS) -v ${PWD}/coverage:/coverage -e COVERAGE_DIR=/coverage $(IMAGE) make test-coverage
.PHONY: test-image test test-coverage
......@@ -55,7 +55,10 @@ Things that haven't been mentioned yet:
- `cron-jobs/devlist-mailer`
- `cron-jobs/sourceballs`
## Testing
* Install the `make` and `docker` packages. Start the docker daemon by issuing `systemctl start docker`.
* Install the `make` and `podman` or `docker` packages depending on your
preferrence. The default expects docker but pomdan can be used if
`DOCKER=podman` is specified. When using docker, start the docker daemon by
issuing `systemctl start docker`.
* The test suite can now be run with `make test`.
* A coverage report can be generated with `make test-coverage`. Open `coverage/index.html` in your web browser to inspect the results.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment