From 39511beaa8406a75f9e529a9f844986d9b5d4ee4 Mon Sep 17 00:00:00 2001 From: librelois Date: Thu, 16 Dec 2021 17:52:59 +0100 Subject: [PATCH] wip --- .github/workflows/build.yml | 38 ++++++++++++++++++++++++++++++++++ .gitignore | 1 + scripts/get-moonbeam-binary.sh | 9 ++++++++ 3 files changed, 48 insertions(+) create mode 100755 scripts/get-moonbeam-binary.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 193949dd..81e012c9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,6 +4,10 @@ on: pull_request: types: [opened, edited, synchronize] +env: + MOONBEAM_GIT_REF: "elois-test-overrides" + MOONBEAM_LAST_CLIENT_TAG: "sha-f996ad83" + jobs: list-spec-versions: @@ -101,3 +105,37 @@ jobs: if: steps.filter.outputs.edited == 'true' || steps.filter.outputs.shared == 'true' run: | ./scripts/check-tracing-runtime.sh ${{ matrix.spec_version }} + + test-last-tracing-runtime: + name: "Test last tracing runtime" + if: github.event.pull_request.draft == false + runs-on: ubuntu-latest + needs: ["check-tracing-runtime"] + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + ref: ${{ github.event.pull_request.head.sha }} + - name: Get moonbeam binary + run: | + ./scripts/get-moonbeam-binary.sh $MOONBEAM_LAST_CLIENT_TAG + - name: "Setup node" + uses: actions/setup-node@v2 + with: + node-version: 14.x + - name: Copy tests folder + run: | + rm -rf tests tmp + mkdir tests tmp + git clone https://github.com/PureStake/moonbeam -b $MOONBEAM_GIT_REF tmp/moonbeam + cp -r tmp/moonbeam/tests tests + - name: Typescript tracing tests (against dev service) + env: + ETHAPI_CMD: --ethapi=txpool,debug,trace + WASM_RUNTIME_OVERRIDES: tests/moonbase-overrides + run: + mkdir -p tests/moonbase-overrides/ + cp wasm/moonbase-* tests/moonbase-overrides/ + cd tests + npm install + node_modules/.bin/mocha --parallel -j 2 -r ts-node/register 'tracing-tests/**/test-*.ts' \ No newline at end of file diff --git a/.gitignore b/.gitignore index 291cd43a..19007a4a 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ build # Ignore temporary files tmp +tests diff --git a/scripts/get-moonbeam-binary.sh b/scripts/get-moonbeam-binary.sh new file mode 100755 index 00000000..f81beff5 --- /dev/null +++ b/scripts/get-moonbeam-binary.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +CLIENT_TAG=$1 +CLIENT_IMAGE="purestake/moonbeam:$CLIENT_TAG" + +mkdir -p target/release +docker create -ti --name dummy $CLIENT_IMAGE bash +docker cp dummy:/moonbeam/moonbeam target/release/moonbeam +docker rm -f dummy