From b7340abb58a8272c0072b16bba16ef0ea4df3403 Mon Sep 17 00:00:00 2001 From: Ry Racherbaumer Date: Mon, 16 Sep 2024 10:44:34 -0500 Subject: [PATCH 1/4] Enable MLS in Docker container --- dev/docker-compose.yml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/dev/docker-compose.yml b/dev/docker-compose.yml index 1ac22727..72530e42 100644 --- a/dev/docker-compose.yml +++ b/dev/docker-compose.yml @@ -1,5 +1,5 @@ services: - waku-node: + node: image: xmtp/node-go:latest platform: linux/amd64 environment: @@ -8,14 +8,29 @@ services: - --store.enable - --store.db-connection-string=postgres://postgres:xmtp@db:5432/postgres?sslmode=disable - --store.reader-db-connection-string=postgres://postgres:xmtp@db:5432/postgres?sslmode=disable + - --mls-store.db-connection-string=postgres://postgres:xmtp@mlsdb:5432/postgres?sslmode=disable + - --mls-validation.grpc-address=validation:50051 + - --api.enable-mls - --wait-for-db=30s - --api.authn.enable ports: - - 9001:9001 - 5555:5555 + - 5556:5556 depends_on: - db + - mlsdb + - validation + + validation: + image: ghcr.io/xmtp/mls-validation-service:main + platform: linux/amd64 + db: image: postgres:13 environment: POSTGRES_PASSWORD: xmtp + + mlsdb: + image: postgres:13 + environment: + POSTGRES_PASSWORD: xmtp From 5266bf8f7d918bbf4301b04f43b9d6707f8cd90c Mon Sep 17 00:00:00 2001 From: Ry Racherbaumer Date: Mon, 16 Sep 2024 10:47:19 -0500 Subject: [PATCH 2/4] Enable MLS client tests in CI --- .github/workflows/mls-client.yml | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/.github/workflows/mls-client.yml b/.github/workflows/mls-client.yml index 9152ac65..57fbd410 100644 --- a/.github/workflows/mls-client.yml +++ b/.github/workflows/mls-client.yml @@ -81,9 +81,27 @@ jobs: test: name: Test - runs-on: ubuntu-latest + runs-on: warp-ubuntu-latest-x64-8x steps: - - run: echo "No tests for MLS Client yet." + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + cache: 'yarn' + env: + SKIP_YARN_COREPACK_CHECK: '1' + - name: Enable corepack + run: corepack enable + - name: Install dependencies + run: yarn + - name: Start dev environment + run: ./dev/up + - name: Sleep for 5 seconds + run: sleep 5s + - name: Run tests + run: | + cd packages/mls-client + yarn test build: name: Build From 4e9115b60e1e3b34d71da880d9fc8aefbf7c156e Mon Sep 17 00:00:00 2001 From: Ry Racherbaumer Date: Mon, 16 Sep 2024 12:50:48 -0500 Subject: [PATCH 3/4] Update docker scripts --- dev/compose | 4 ++++ dev/docker-compose | 4 ---- dev/down | 5 +++-- dev/up | 11 ++++------- 4 files changed, 11 insertions(+), 13 deletions(-) create mode 100755 dev/compose delete mode 100755 dev/docker-compose diff --git a/dev/compose b/dev/compose new file mode 100755 index 00000000..df7a8507 --- /dev/null +++ b/dev/compose @@ -0,0 +1,4 @@ +#!/bin/bash +set -eou pipefail + +docker compose -f dev/docker-compose.yml -p "xmtp-js" "$@" diff --git a/dev/docker-compose b/dev/docker-compose deleted file mode 100755 index c5d11929..00000000 --- a/dev/docker-compose +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -set -e - -docker compose -p xmtp-js -f dev/docker-compose.yml "$@" diff --git a/dev/down b/dev/down index 8589caf4..b065396e 100755 --- a/dev/down +++ b/dev/down @@ -1,4 +1,5 @@ #!/bin/bash -set -e +set -eou pipefail +script_dir="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" -dev/docker-compose down +"${script_dir}"/compose down diff --git a/dev/up b/dev/up index 4f80ebce..2ebaea4e 100755 --- a/dev/up +++ b/dev/up @@ -1,9 +1,6 @@ #!/bin/bash -set -e +set -eou pipefail +script_dir="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" -if ! which docker &>/dev/null; then - echo "Docker required to run dev/up. Install it and run this again." - exit 1 -fi - -dev/docker-compose up -d +"${script_dir}"/compose pull +"${script_dir}"/compose up -d --wait From afdfedda950154f28698c3b0faf8beb94c8df173 Mon Sep 17 00:00:00 2001 From: Ry Racherbaumer Date: Mon, 16 Sep 2024 12:52:11 -0500 Subject: [PATCH 4/4] Use warp.build for JS SDK tests --- .github/workflows/js-sdk.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/js-sdk.yml b/.github/workflows/js-sdk.yml index ab79652e..8d957503 100644 --- a/.github/workflows/js-sdk.yml +++ b/.github/workflows/js-sdk.yml @@ -81,8 +81,7 @@ jobs: test: name: Test - # TODO: Investigate why fetch is failing for some of these tests on warp build runners - runs-on: ubuntu-latest + runs-on: warp-ubuntu-latest-x64-8x steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 @@ -95,8 +94,12 @@ jobs: run: corepack enable - name: Install dependencies run: yarn - - run: ./dev/up - - run: | + - name: Start dev environment + run: ./dev/up + - name: Sleep for 5 seconds + run: sleep 5s + - name: Run node tests + run: | cd packages/js-sdk yarn test:node env: @@ -105,7 +108,8 @@ jobs: DD_SERVICE: xmtp-js DD_CIVISIBILITY_AGENTLESS_ENABLED: 'true' DD_API_KEY: ${{ secrets.DD_API_KEY }} - - run: | + - name: Run browser tests + run: | cd packages/js-sdk yarn test:browser