From 141a39bd66ebb398529d5ebfd234fb4e796b8614 Mon Sep 17 00:00:00 2001 From: leeturner Date: Mon, 16 Dec 2024 14:00:45 +0000 Subject: [PATCH 1/5] Update the docker compose command for the integration tests Github no longer support the `docker-compose` command. They have moved to the `docker compose` version instead --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9fedd6c..d159542 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -45,5 +45,5 @@ jobs: - name: Integration Tests run: | cd examples/ - docker-compose build overview_srv - docker-compose run overview_srv pytest --tb=short + docker compose build overview_srv + docker compose run overview_srv pytest --tb=short From d03b1bb6a3ccb1a87c4f817a4b3ca10ff1b78361 Mon Sep 17 00:00:00 2001 From: leeturner Date: Mon, 16 Dec 2024 18:08:40 +0000 Subject: [PATCH 2/5] Fix the directory referenced in the integration-tests job Also fixed the context in the examples docker file --- .github/workflows/tests.yml | 2 +- examples/intro/docker-compose.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d159542..5b8c143 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -44,6 +44,6 @@ jobs: - name: Integration Tests run: | - cd examples/ + cd examples/intro/ docker compose build overview_srv docker compose run overview_srv pytest --tb=short diff --git a/examples/intro/docker-compose.yml b/examples/intro/docker-compose.yml index 5637014..ba27f19 100644 --- a/examples/intro/docker-compose.yml +++ b/examples/intro/docker-compose.yml @@ -3,7 +3,7 @@ version: "3" services: overview_srv: build: - context: ../ + context: ../../ dockerfile: examples/intro/Dockerfile ports: - "5001:5001" @@ -19,7 +19,7 @@ services: products_srv: build: - context: ../ + context: ../../ dockerfile: examples/intro/Dockerfile ports: - "5002:5002" From 664e55c10c424bef756e4748ca67be7c9a017c18 Mon Sep 17 00:00:00 2001 From: leeturner Date: Mon, 16 Dec 2024 18:27:24 +0000 Subject: [PATCH 3/5] fix docker compose command in the docs --- examples/intro/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/intro/README.md b/examples/intro/README.md index 9ff6ae2..cdc054a 100644 --- a/examples/intro/README.md +++ b/examples/intro/README.md @@ -42,7 +42,7 @@ to allow us to write solid integration tests that dont involved mockig the code To run the tests use docker-compose to create the necessary containers. -`docker-compose run overview_srv pytest --tb=short` +`docker compose run overview_srv pytest --tb=short` ## How we use this example code base From 9205c8e3e507b445209db6330f29891bf5d15e26 Mon Sep 17 00:00:00 2001 From: leeturner Date: Mon, 16 Dec 2024 21:13:06 +0000 Subject: [PATCH 4/5] Update volume paths in docker-compose.yml for consistency --- examples/intro/docker-compose.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/intro/docker-compose.yml b/examples/intro/docker-compose.yml index ba27f19..6d63829 100644 --- a/examples/intro/docker-compose.yml +++ b/examples/intro/docker-compose.yml @@ -13,7 +13,7 @@ services: - "host.docker.internal:host-gateway" volumes: - /var/run/docker.sock:/var/run/docker.sock - - ..:/app/ + - ../../app/ - .:/app/example/ command: uvicorn product_mock.overview_service:app --host=0.0.0.0 --port=5001 @@ -24,6 +24,6 @@ services: ports: - "5002:5002" volumes: - - ..:/app/ + - ../../:/app/ - .:/app/example/ command: uvicorn product_mock.products_service:app --host=0.0.0.0 --port=5002 From d42725c15e1322da496c154a7121dd82f9332228 Mon Sep 17 00:00:00 2001 From: Lee Turner Date: Mon, 16 Dec 2024 22:10:43 +0000 Subject: [PATCH 5/5] Update examples/intro/docker-compose.yml Co-authored-by: Alexandru Jircan --- examples/intro/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/intro/docker-compose.yml b/examples/intro/docker-compose.yml index 6d63829..0192c5e 100644 --- a/examples/intro/docker-compose.yml +++ b/examples/intro/docker-compose.yml @@ -13,7 +13,7 @@ services: - "host.docker.internal:host-gateway" volumes: - /var/run/docker.sock:/var/run/docker.sock - - ../../app/ + - ../../:/app/ - .:/app/example/ command: uvicorn product_mock.overview_service:app --host=0.0.0.0 --port=5001