From 6c7a09990a286161d5f89f1997a9e1e66772aa87 Mon Sep 17 00:00:00 2001 From: lizozom Date: Wed, 20 Mar 2024 10:39:23 +0200 Subject: [PATCH 1/3] chore: move FHIR server docker compose file into tests --- .gitignore | 2 +- docker-compose.yml => tests/docker-compose.yml | 0 hapi.application.yaml => tests/hapi.application.yaml | 0 tests/setup.ts | 6 +++++- 4 files changed, 6 insertions(+), 2 deletions(-) rename docker-compose.yml => tests/docker-compose.yml (100%) rename hapi.application.yaml => tests/hapi.application.yaml (100%) diff --git a/.gitignore b/.gitignore index 6fd4774..b03677a 100644 --- a/.gitignore +++ b/.gitignore @@ -7,5 +7,5 @@ node_modules .env .env.test .eslintcache -hapi.postgress.data +**/hapi.postgress.data diff --git a/docker-compose.yml b/tests/docker-compose.yml similarity index 100% rename from docker-compose.yml rename to tests/docker-compose.yml diff --git a/hapi.application.yaml b/tests/hapi.application.yaml similarity index 100% rename from hapi.application.yaml rename to tests/hapi.application.yaml diff --git a/tests/setup.ts b/tests/setup.ts index 90c28b5..85c7706 100644 --- a/tests/setup.ts +++ b/tests/setup.ts @@ -48,7 +48,11 @@ async function waitForFhirApi (maxAttempts, currentAttempt = 1) { async function setup () { console.log('starting FHIR server...'); - await compose.upAll({ cwd: path.join(__dirname), log: true }); + await compose.upAll({ + cwd: path.join(__dirname), + config: 'docker-compose.yml', + log: true + }); const result = await compose.ps({ cwd: path.join(__dirname) }); globalThis.services = result.data.services; From 6624e2eacc07785371e0a862bfb3469af6cf1cb1 Mon Sep 17 00:00:00 2001 From: lizozom Date: Wed, 20 Mar 2024 14:11:11 +0200 Subject: [PATCH 2/3] chore: fix teardown --- tests/teardown.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/teardown.ts b/tests/teardown.ts index d6e33b4..5e5ec22 100644 --- a/tests/teardown.ts +++ b/tests/teardown.ts @@ -3,10 +3,15 @@ * Project name: FUME-COMMUNITY */ import * as compose from 'docker-compose'; +import path from 'path'; async function teardown () { console.log('stopping FHIR server...'); - await compose.stopMany(globalThis.services); + await compose.stop({ + cwd: path.join(__dirname), + config: 'docker-compose.yml', + log: true + }); console.log('closing server'); globalThis.fumeServer.shutDown(); From 25b374ac519f8065b6d3d51d24a91adf90098cfb Mon Sep 17 00:00:00 2001 From: lizozom Date: Wed, 20 Mar 2024 14:12:03 +0200 Subject: [PATCH 3/3] chore: update ignore files --- .eslintignore | 2 +- .npmignore | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.eslintignore b/.eslintignore index 8d27f99..3e4fb8c 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,2 +1,2 @@ dist -hapi.postgress.data \ No newline at end of file +**/hapi.postgress.data \ No newline at end of file diff --git a/.npmignore b/.npmignore index 78ed0d4..0c4848d 100644 --- a/.npmignore +++ b/.npmignore @@ -1,3 +1,4 @@ # .npmignore node_modules -serve \ No newline at end of file +serve +**/hapi.postgress.data \ No newline at end of file