diff --git a/.github/workflows/abi_wasm.yml b/.github/workflows/abi_wasm.yml index fccaeceaa1d..8746254615e 100644 --- a/.github/workflows/abi_wasm.yml +++ b/.github/workflows/abi_wasm.yml @@ -110,6 +110,7 @@ jobs: path: ./result - name: Query playwright version + working-directory: ./crates/noirc_abi_wasm run: echo "PLAYWRIGHT_VERSION=$(yarn info @web/test-runner-playwright --json | jq .children.Version)" >> $GITHUB_ENV - name: Cache playwright binaries diff --git a/.github/workflows/wasm.yml b/.github/workflows/wasm.yml index 5811f1666a7..cbed8592135 100644 --- a/.github/workflows/wasm.yml +++ b/.github/workflows/wasm.yml @@ -119,45 +119,50 @@ jobs: path: ${{ env.UPLOAD_PATH }} retention-days: 3 - # test: - # needs: [build-wasm, build-nargo] - # name: Test noir_wasm - # runs-on: ubuntu-latest - # steps: - # - name: Checkout noir-lang/noir - # uses: actions/checkout@v4 - - # - name: Download wasm package artifact - # uses: actions/download-artifact@v3 - # with: - # name: noir_wasm - # path: ./crates/wasm/result - - # - name: Download nargo binary - # uses: actions/download-artifact@v3 - # with: - # name: nargo - # path: ./nargo - - # - name: Compile test program with Nargo CLI - # working-directory: ./crates/wasm/noir-script - # run: | - # nargo_binary=${{ github.workspace }}/nargo/nargo - # chmod +x $nargo_binary - # $nargo_binary compile - - # - name: Install dependencies - # working-directory: ./crates/wasm - # run: yarn install - - # - name: Install playwright deps - # working-directory: ./crates/wasm - # run: | - # npx playwright install - # npx playwright install-deps - - # - name: Run tests - # working-directory: ./crates/wasm - # run: | - # yarn test:browser - # yarn test:node + test: + needs: [build-wasm, build-nargo] + name: Test noir_wasm + runs-on: ubuntu-latest + steps: + - name: Checkout noir-lang/noir + uses: actions/checkout@v4 + + - name: Download wasm package artifact + uses: actions/download-artifact@v3 + with: + name: noir_wasm + path: ./crates/wasm/result + + - name: Download nargo binary + uses: actions/download-artifact@v3 + with: + name: nargo + path: ./nargo + + - name: Compile test program with Nargo CLI + working-directory: ./crates/wasm/noir-script + run: | + nargo_binary=${{ github.workspace }}/nargo/nargo + chmod +x $nargo_binary + $nargo_binary compile + + - name: Set up test environment + uses: ./.github/actions/setup + with: + working-directory: ./crates/wasm + + - name: Install dependencies + working-directory: ./crates/wasm + run: yarn install + + - name: Install playwright deps + working-directory: ./crates/wasm + run: | + npx playwright install + npx playwright install-deps + + - name: Run tests + working-directory: ./crates/wasm + run: | + yarn test:browser + yarn test:node diff --git a/crates/wasm/web-test-runner.config.mjs b/crates/wasm/web-test-runner.config.mjs index 0d872815f0f..5921e9add5f 100644 --- a/crates/wasm/web-test-runner.config.mjs +++ b/crates/wasm/web-test-runner.config.mjs @@ -1,3 +1,4 @@ +import { fileURLToPath } from 'url'; import { esbuildPlugin } from "@web/dev-server-esbuild"; import { playwrightLauncher } from "@web/test-runner-playwright";