Skip to content

Commit

Permalink
Move docker compose to test (#47)
Browse files Browse the repository at this point in the history
* chore: move FHIR server docker compose file into tests

* chore: fix teardown

* chore: update ignore files
  • Loading branch information
lizozom authored Mar 20, 2024
1 parent 5cfa8b2 commit 838a823
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
dist
hapi.postgress.data
**/hapi.postgress.data
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ node_modules
.env
.env.test
.eslintcache
hapi.postgress.data
**/hapi.postgress.data

3 changes: 2 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# .npmignore
node_modules
serve
serve
**/hapi.postgress.data
File renamed without changes.
File renamed without changes.
6 changes: 5 additions & 1 deletion tests/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 6 additions & 1 deletion tests/teardown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 838a823

Please sign in to comment.