Skip to content

Commit

Permalink
CI: add job test-last-tracing-runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
librelois committed Jan 3, 2022
1 parent 06d4e87 commit 8678a40
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 2 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
pull_request:
types: [opened, edited, synchronize]

env:
MOONBEAM_GIT_REF: "elois-test-overrides"
MOONBEAM_LAST_CLIENT_TAG: "v0.18.0"

jobs:

list-spec-versions:
Expand Down Expand Up @@ -101,3 +105,34 @@ 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 --depth 1 -b $MOONBEAM_GIT_REF tmp/moonbeam
cp -r tmp/moonbeam/moonbeam-types-bundle .
cp -r tmp/moonbeam/tests .
- name: Typescript tracing tests (against dev service)
continue-on-error: true
env:
ETHAPI_CMD: --ethapi=txpool,debug,trace
WASM_RUNTIME_OVERRIDES: moonbase-overrides
run: ./scripts/test-last-tracing-runtime.sh
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@
# Ignore build directory populated by CI
build

# Ignore temporary files
# Ignore moonbeam test files
moonbeam-types-bundle
tests
tmp
9 changes: 9 additions & 0 deletions scripts/get-moonbeam-binary.sh
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion scripts/import-tracing-runtime.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ GIT_REF=${2:-"runtime-$SPEC_VERSION"}
echo "Get moonbeam branch..."
rm -rf tmp
mkdir tmp
git clone https://github.com/PureStake/moonbeam -b $GIT_REF tmp/moonbeam
git clone https://github.com/PureStake/moonbeam --depth 1 -b $GIT_REF tmp/moonbeam

# Copy relevant files
echo "Copy relevant files and folders..."
Expand Down
13 changes: 13 additions & 0 deletions scripts/test-last-tracing-runtime.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

WASM_RUNTIME_OVERRIDES="moonbase-overrides"

chmod uog+x target/release/moonbeam
mkdir -p tests/$WASM_RUNTIME_OVERRIDES
cp wasm/moonbase-* tests/$WASM_RUNTIME_OVERRIDES
cd moonbeam-types-bundle
npm install
npm run build
cd ../tests
npm install
node_modules/.bin/mocha --parallel -j 1 -r ts-node/register 'tracing-tests/**/test-*.ts'

0 comments on commit 8678a40

Please sign in to comment.