From 9e3a0a63ee80515d40d68a1f2f9e6d61490b2e86 Mon Sep 17 00:00:00 2001 From: finn Date: Mon, 31 Jul 2023 16:25:02 -0700 Subject: [PATCH] test against a local copy of the dwn server --- .github/workflows/tests-ci.yml | 10 ++++++++++ testfiles/docker-compose.yaml | 8 ++++++++ 2 files changed, 18 insertions(+) create mode 100644 testfiles/docker-compose.yaml diff --git a/.github/workflows/tests-ci.yml b/.github/workflows/tests-ci.yml index 031ef851b..025199773 100644 --- a/.github/workflows/tests-ci.yml +++ b/.github/workflows/tests-ci.yml @@ -49,9 +49,17 @@ jobs: - name: Run linter for all packages run: npm run lint --ws + + - name: start services tests need + run: cd testfiles && docker-compose up -d + + - name: wait for services to be ready + run: until curl -sf http://localhost:3000/health; do sleep .1; done && until curl -sf http://localhost:8080/health; do echo -n .; sleep .1; done - name: Run tests for all packages run: npm run test:node --ws + env: + DWN_URL: http://localhost:3000 - name: Upload test coverage to Codecov uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4 @@ -85,3 +93,5 @@ jobs: - name: Run tests for all packages run: npm run test:browser --ws + env: + DWN_URL: http://localhost:3000 diff --git a/testfiles/docker-compose.yaml b/testfiles/docker-compose.yaml new file mode 100644 index 000000000..a19a1b015 --- /dev/null +++ b/testfiles/docker-compose.yaml @@ -0,0 +1,8 @@ +version: "3.98" + +services: + dwn-node: + container_name: dwn-node + image: ghcr.io/tbd54566975/dwn-server:dwn-sdk-0.0.35 + ports: + - "3000:3000"