From 5b433e7edbaba17b43d606a3b0bebacf58fbbf6f Mon Sep 17 00:00:00 2001 From: Konstantin Baierer Date: Tue, 30 Jan 2024 12:59:07 +0100 Subject: [PATCH 1/2] ci/integration-test: install docker via brew for macos --- .github/workflows/integration-test.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml index 1915a4f3d9..15d692e53e 100644 --- a/.github/workflows/integration-test.yml +++ b/.github/workflows/integration-test.yml @@ -44,6 +44,11 @@ jobs: brew install imagemagick geos bash # opencv fi make install deps-test + - name: Install Docker on macOS + if: runner.os == 'macos' + run: | + brew install docker docker-compose + colima start - name: Test network integration with pytest run: | make integration-test From 0f1992ed167bb3c3a572242e8e7dca836261c291 Mon Sep 17 00:00:00 2001 From: Konstantin Baierer Date: Tue, 30 Jan 2024 13:49:25 +0100 Subject: [PATCH 2/2] make integration-test: DOCKER_COMPOSE overrideable --- .github/workflows/integration-test.yml | 6 +++++- Makefile | 6 ++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml index 15d692e53e..858f6d47a7 100644 --- a/.github/workflows/integration-test.yml +++ b/.github/workflows/integration-test.yml @@ -51,4 +51,8 @@ jobs: colima start - name: Test network integration with pytest run: | - make integration-test + if [[ "${{ matrix.os }}" == "macos"* ]];then + make integration-test DOCKER_COMPOSE=docker-compose + else + make integration-test + fi diff --git a/Makefile b/Makefile index 6be39d7a1c..06e864d194 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,8 @@ TESTDIR = $(CURDIR)/tests PYTEST_ARGS = --continue-on-collection-errors VERSION = $(shell cat VERSION) +DOCKER_COMPOSE = docker compose + SPHINX_APIDOC = BUILD_ORDER = ocrd_utils ocrd_models ocrd_modelfactory ocrd_validators ocrd_network ocrd @@ -219,10 +221,10 @@ test: assets INTEGRATION_TEST_IN_DOCKER = docker exec core_test integration-test: - docker compose -f tests/network/docker-compose.yml up -d + $(DOCKER_COMPOSE) --file tests/network/docker-compose.yml up -d sleep 20 $(INTEGRATION_TEST_IN_DOCKER) pytest -k 'test_rmq or test_db or test_processing_server' -v - docker compose -f tests/network/docker-compose.yml down --remove-orphans + $(DOCKER_COMPOSE) --file tests/network/docker-compose.yml down --remove-orphans benchmark: $(PYTHON) -m pytest $(TESTDIR)/model/test_ocrd_mets_bench.py