Skip to content

Commit

Permalink
test against a local copy of the dwn server
Browse files Browse the repository at this point in the history
* tests check for environment variable DWN_URL and use that as the dwn server if specified
* dwn-server launched in docker container during tests, DWN_URL is set
  • Loading branch information
finn-tbd committed Aug 22, 2023
1 parent 7392aa3 commit 1d2cc96
Show file tree
Hide file tree
Showing 7 changed files with 778 additions and 1,715 deletions.
32 changes: 30 additions & 2 deletions .github/workflows/tests-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,16 @@ jobs:
- name: Run linter for all packages
run: npm run lint --ws

- name: Start dwn-server container
run: cd packages/dev-env && docker-compose up -d

- name: Wait for dwn-server to be ready
run: until curl -sf http://localhost:3000/health; do echo -n .; sleep .1; done

- name: Run tests for all packages
run: npm run test:node --ws
run: npm run test:node --ws -- --color
env:
TEST_DWN_URL: http://localhost:3000

- name: Upload test coverage to Codecov
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4
Expand Down Expand Up @@ -83,5 +91,25 @@ jobs:
- name: Build all workspace packages
run: npm run build

- name: Install docker
run: brew install docker && brew install docker-compose # && colima start

- name: Update qemu to work around https://github.com/actions/runner-images/issues/8104
run: |
brew remove --ignore-dependencies qemu &&
curl -o ./qemu.rb https://raw.githubusercontent.com/Homebrew/homebrew-core/dc0669eca9479e9eeb495397ba3a7480aaa45c2e/Formula/qemu.rb &&
brew install ./qemu.rb
- name: Start docker
run: colima start

- name: Start dwn-server container
run: cd packages/dev-env && docker-compose up -d

- name: Wait for dwn-server to be ready
run: until curl -sf http://localhost:3000/health; do echo -n .; sleep .1; done

- name: Run tests for all packages
run: npm run test:browser --ws
run: npm run test:browser --ws -- --color
env:
TEST_DWN_URL: http://localhost:3000
Loading

0 comments on commit 1d2cc96

Please sign in to comment.