Skip to content

Commit

Permalink
tests: setup consensus module e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ptrus committed Apr 28, 2021
1 parent 2e6e994 commit 05e4bf6
Show file tree
Hide file tree
Showing 14 changed files with 117 additions and 78 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/ci-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ jobs:
- name: 'testnet: Download artifacts'
working-directory: client-sdk/ts-web/core/playground
run: ./download-artifacts.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: 'testnet: Start'
working-directory: client-sdk/ts-web/core/playground
Expand Down Expand Up @@ -227,6 +229,8 @@ jobs:
- name: 'testnet: Download artifacts'
working-directory: client-sdk/ts-web/rt/playground
run: ./download-artifacts.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: 'testnet: Build runtime'
working-directory: client-sdk/ts-web/rt/playground
Expand All @@ -253,6 +257,14 @@ jobs:
name: e2e-ts-web-rt-screenshots
path: client-sdk/ts-web/rt/cypress/screenshots

- name: Upload logs
if: failure()
uses: actions/upload-artifact@v2
with:
name: e2e-ts-web-rt-logs
path: |
/tmp/oasis-net-runner-sdk-rt/**/*.log
e2e-rt:
# NOTE: This name appears in GitHub's Checks API.
name: e2e-rt
Expand All @@ -274,5 +286,14 @@ jobs:
sudo apt-get update
sudo apt-get install bubblewrap build-essential libseccomp-dev libssl-dev protobuf-compiler
- name: Download artifacts
working-directory: tests/
run: ./download-artifacts.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Run end-to-end tests
run: ./tests/run-e2e.sh
env:
TEST_NODE_BINARY: "${{ github.workspace }}/tests/untracked/oasis-node"
TEST_RUNTIME_LOADER: "${{ github.workspace}}/tests/untracked/oasis-core-runtime-loader"
1 change: 1 addition & 0 deletions client-sdk/ts-web/core/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
/node_modules
/playground/dist/main.js
/playground/untracked
package-lock.json
12 changes: 1 addition & 11 deletions client-sdk/ts-web/core/playground/download-artifacts.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
#!/bin/sh -eux
. ./consts.sh

mkdir -p untracked
if [ ! -e "untracked/oasis_core_${OASIS_CORE_VERSION}_linux_amd64/oasis-node" ]; then
(
cd untracked
curl -fLO "https://github.com/oasisprotocol/oasis-core/releases/download/v$OASIS_CORE_VERSION/oasis_core_${OASIS_CORE_VERSION}_linux_amd64.tar.gz"
tar -xf "oasis_core_${OASIS_CORE_VERSION}_linux_amd64.tar.gz" \
"oasis_core_${OASIS_CORE_VERSION}_linux_amd64/oasis-node" \
"oasis_core_${OASIS_CORE_VERSION}_linux_amd64/oasis-net-runner"
)
fi
../../../../tests/download-artifacts.sh
8 changes: 4 additions & 4 deletions client-sdk/ts-web/core/playground/sample-run-network.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/bin/sh -eux
. ./consts.sh

./download-artifacts.sh
NET_RUNNER="${TEST_NET_RUNNER:-./untracked/oasis-net-runner}"
NODE_BINARY="${TEST_NODE_BINARY:-./untracked/oasis-node}"

mkdir -p /tmp/oasis-net-runner-sdk-core
"./untracked/oasis_core_${OASIS_CORE_VERSION}_linux_amd64/oasis-net-runner" \
--fixture.default.node.binary "untracked/oasis_core_${OASIS_CORE_VERSION}_linux_amd64/oasis-node" \
"${NET_RUNNER}" \
--fixture.default.node.binary "${NODE_BINARY}" \
--fixture.default.setup_runtimes=false \
--basedir /tmp/oasis-net-runner-sdk-core \
--basedir.no_temp_dir
1 change: 1 addition & 0 deletions client-sdk/ts-web/rt/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
/node_modules
/playground/dist/main.js
/playground/untracked
package-lock.json
12 changes: 9 additions & 3 deletions client-sdk/ts-web/rt/playground/consts.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
OASIS_CORE_VERSION=21.1.1
BUILD_NUMBER=4639
SIMPLE_KEYMANAGER_ARTIFACT=https://buildkite.com/organizations/oasisprotocol/pipelines/oasis-core-ci/builds/4639/jobs/e805cf5f-a784-4255-b728-df4baeda191f/artifacts/cdc14220-2b84-435e-828c-33e75cec6261
OASIS_CORE_VERSION=21.1-dev
# To download a pre-released version of oasis-core built by oasis-core/release-dev action
# set artifact ID to use here.
# To download a released version of oasis-core unset this variable.
GITHUB_ARTIFACT=55969988 # 17d2861

# Keymanager.
BUILD_NUMBER=4641 # 17d2861
SIMPLE_KEYMANAGER_ARTIFACT=https://buildkite.com/organizations/oasisprotocol/pipelines/oasis-core-ci/builds/4641/jobs/34be2831-e245-46bd-8a18-a296b6f3b9e3/artifacts/870fbb01-03e5-4c60-b261-8abcb14acdcc
19 changes: 5 additions & 14 deletions client-sdk/ts-web/rt/playground/download-artifacts.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
#!/bin/sh -eux
. ./consts.sh

mkdir -p untracked
if [ ! -e "untracked/oasis_core_${OASIS_CORE_VERSION}_linux_amd64/oasis-node" ]; then
(
cd untracked
curl -fLO "https://github.com/oasisprotocol/oasis-core/releases/download/v$OASIS_CORE_VERSION/oasis_core_${OASIS_CORE_VERSION}_linux_amd64.tar.gz"
tar -xf "oasis_core_${OASIS_CORE_VERSION}_linux_amd64.tar.gz" \
"oasis_core_${OASIS_CORE_VERSION}_linux_amd64/oasis-node" \
"oasis_core_${OASIS_CORE_VERSION}_linux_amd64/oasis-net-runner" \
"oasis_core_${OASIS_CORE_VERSION}_linux_amd64/oasis-core-runtime-loader"
)
fi
if [ ! -e "untracked/simple-keymanager-$BUILD_NUMBER" ]; then
curl -fLo "untracked/simple-keymanager-$BUILD_NUMBER" "$SIMPLE_KEYMANAGER_ARTIFACT"
chmod +x "untracked/simple-keymanager-$BUILD_NUMBER"
../../../../tests/download-artifacts.sh

if [ ! -e "untracked/simple-keymanager" ]; then
curl -fLo "untracked/simple-keymanager" "$SIMPLE_KEYMANAGER_ARTIFACT"
chmod +x "untracked/simple-keymanager"
fi
15 changes: 8 additions & 7 deletions client-sdk/ts-web/rt/playground/sample-run-network.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
#!/bin/sh -eux
. ./consts.sh

./download-artifacts.sh
./build-runtime.sh
NET_RUNNER="${TEST_NET_RUNNER:-./untracked/oasis-net-runner}"
NODE_BINARY="${TEST_NODE_BINARY:-./untracked/oasis-node}"
RUNTIME_LOADER="${TEST_RUNTIME_LOADER:-./untracked/oasis-core-runtime-loader}"
KM_BINARY="${TEST_KM_BINARY:-./untracked/simple-keymanager}"

mkdir -p /tmp/oasis-net-runner-sdk-rt
"./untracked/oasis_core_${OASIS_CORE_VERSION}_linux_amd64/oasis-net-runner" \
--fixture.default.node.binary "untracked/oasis_core_${OASIS_CORE_VERSION}_linux_amd64/oasis-node" \
"${NET_RUNNER}" \
--fixture.default.node.binary "${NODE_BINARY}" \
--fixture.default.runtime.binary ../../../../target/debug/test-runtime-simple-keyvalue \
--fixture.default.runtime.loader "untracked/oasis_core_${OASIS_CORE_VERSION}_linux_amd64/oasis-core-runtime-loader" \
--fixture.default.keymanager.binary "untracked/simple-keymanager-$BUILD_NUMBER" \
--fixture.default.runtime.loader "${RUNTIME_LOADER}" \
--fixture.default.keymanager.binary "${KM_BINARY}" \
--basedir /tmp/oasis-net-runner-sdk-rt \
--basedir.no_temp_dir
1 change: 1 addition & 0 deletions tests/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
untracked
5 changes: 5 additions & 0 deletions tests/consts.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
OASIS_CORE_VERSION=21.1-dev
# To download a pre-released version of oasis-core built by oasis-core/release-dev action
# set artifact ID to use here.
# To download a released version of oasis-core unset this variable.
GITHUB_ARTIFACT=55969988 # 17d2861
22 changes: 22 additions & 0 deletions tests/download-artifacts.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/sh -eux
. ./consts.sh

mkdir -p untracked
if [ ! -e "untracked/oasis-node" ]; then
(
cd untracked
if [ ! -z "${GITHUB_ARTIFACT:-}" ]; then
# Authentication is required to download the artifacts, although those are public.
curl -fL -o oasis-core.zip -H "Authorization: Bearer ${GITHUB_TOKEN}" "https://api.github.com/repos/oasisprotocol/oasis-core/actions/artifacts/${GITHUB_ARTIFACT}/zip"
unzip oasis-core.zip
else
curl -fLO "https://github.com/oasisprotocol/oasis-core/releases/download/v$OASIS_CORE_VERSION/oasis_core_${OASIS_CORE_VERSION}_linux_amd64.tar.gz"
fi

tar -xf "oasis_core_${OASIS_CORE_VERSION}_linux_amd64.tar.gz" \
--strip-components=1 \
"oasis_core_${OASIS_CORE_VERSION}_linux_amd64/oasis-node" \
"oasis_core_${OASIS_CORE_VERSION}_linux_amd64/oasis-net-runner" \
"oasis_core_${OASIS_CORE_VERSION}_linux_amd64/oasis-core-runtime-loader"
)
fi
4 changes: 2 additions & 2 deletions tests/e2e/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ replace (
)

require (
github.com/oasisprotocol/oasis-core/go v0.2100.1
github.com/oasisprotocol/oasis-core/go v0.2101.1
github.com/oasisprotocol/oasis-sdk/client-sdk/go v0.0.0-20210328195842-4de788c1c6f7
google.golang.org/grpc v1.36.0
google.golang.org/grpc v1.36.1
)
30 changes: 19 additions & 11 deletions tests/e2e/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,9 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM=
github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golang/snappy v0.0.3 h1:fHPg5GQYlCeLIPB9BZqMVR5nR9A+IM5zcgeTdjMYmLA=
Expand All @@ -275,6 +278,8 @@ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M=
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/gopacket v1.1.17 h1:rMrlX2ZY2UbvT+sdz3+6J+pp2z+msCq9MxTU6ymxbBY=
github.com/google/gopacket v1.1.17/go.mod h1:UdDNZ1OO62aGYVnPhxT1U6aI7ukYtA/kB8vaU0diBUM=
Expand Down Expand Up @@ -761,9 +766,8 @@ github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI
github.com/oasisprotocol/deoxysii v0.0.0-20200527154044-851aec403956/go.mod h1:cE5EgXTIhq5oAVdZ7LZd1FjTRLALPEzv93CWzBtDkyI=
github.com/oasisprotocol/ed25519 v0.0.0-20210127160119-f7017427c1ea h1:r4MhxgqQ1bed0fQhRINBM50Rbwsgma6oEjG4zQ444Lw=
github.com/oasisprotocol/ed25519 v0.0.0-20210127160119-f7017427c1ea/go.mod h1:IZbb50w3AB72BVobEF6qG93NNSrTw/V2QlboxqSu3Xw=
github.com/oasisprotocol/oasis-core/go v0.2100.1 h1:4kRa3DCmAhP2KFzYPU7Xn5eqVU+2hZWy6uMqWmNB/Cg=
github.com/oasisprotocol/oasis-core/go v0.2100.1/go.mod h1:jk+oiYXYmBam8FamI2XCZmazOdZ0AIBzAtMuZ+ZlWdU=
github.com/oasisprotocol/oasis-sdk v0.0.0-20210408174620-3b123535afd1 h1:mlK1/GsbsIFDnBxqU6Ro2USz6bvxLswC1+0gFuvvoos=
github.com/oasisprotocol/oasis-core/go v0.2101.1 h1:QgJ+eDyL8hnJaoKmB/ncHydoHYjlAFDaHLV3yr6xSl4=
github.com/oasisprotocol/oasis-core/go v0.2101.1/go.mod h1:1eAVfUqu9R9JNpaCMkqht63Wd39Pzqf7LS9gqZFeUC8=
github.com/oasisprotocol/safeopen v0.0.0-20200528085122-e01cfdfc7661 h1:MB73kGMtuMGS+6VDoU/mitzff7Cu+aZo9ta5wabuxVA=
github.com/oasisprotocol/safeopen v0.0.0-20200528085122-e01cfdfc7661/go.mod h1:SwBxaVibf6Sr2IZ6M3WnUue0yp8dPLAo1riQRNQ60+g=
github.com/oasisprotocol/tendermint v0.34.8-oasis1 h1:lY0N4K5/QkN4eneE0DVcrQb72d4dnckkq/20Xg7DHgo=
Expand Down Expand Up @@ -825,8 +829,8 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn
github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og=
github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M=
github.com/prometheus/client_golang v1.8.0/go.mod h1:O9VU6huf47PktckDQfMTX0Y8tY0/7TSWwj+ITvv0TnM=
github.com/prometheus/client_golang v1.9.0 h1:Rrch9mh17XcxvEu9D9DEpb4isxjGBtcevQjKvxPRQIU=
github.com/prometheus/client_golang v1.9.0/go.mod h1:FqZLKOZnGdFAhOK4nqGHa7D66IdsO+O441Eve7ptJDU=
github.com/prometheus/client_golang v1.10.0 h1:/o0BDeWzLWXNZ+4q5gXltUvaMpJqckTa+jTNoB+z4cg=
github.com/prometheus/client_golang v1.10.0/go.mod h1:WJM3cc3yu7XKBKa/I8WeZm+V3eltZnBwfENSU7mdogU=
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
Expand All @@ -841,9 +845,9 @@ github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y8
github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA=
github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo=
github.com/prometheus/common v0.14.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s=
github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s=
github.com/prometheus/common v0.19.0 h1:Itb4+NjG9wRdkAWgVucbM/adyIXxEhbw0866e0uZE6A=
github.com/prometheus/common v0.19.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s=
github.com/prometheus/common v0.18.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s=
github.com/prometheus/common v0.20.0 h1:pfeDeUdQcIxOMutNjCejsEFp7qeP+/iltHSSmLpE+hU=
github.com/prometheus/common v0.20.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s=
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
Expand Down Expand Up @@ -1158,9 +1162,10 @@ golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201015000850-e3ed0017c211/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c h1:VwygUrnw9jn88c4u8GD3rZQbqrP/tgas88tPUbBxQrk=
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210309074719-68d13333faf2 h1:46ULzRKLh1CwgRq2dC5SlBzEqqNCi8rreOZnNrbqcIY=
golang.org/x/sys v0.0.0-20210309074719-68d13333faf2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Expand Down Expand Up @@ -1259,8 +1264,8 @@ google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM
google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0=
google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
google.golang.org/grpc v1.36.0 h1:o1bcQ6imQMIOpdrO3SWf2z5RV72WbDwdXuK0MDlc8As=
google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
google.golang.org/grpc v1.36.1 h1:cmUfbeGKnz9+2DD/UYsMQXeqbHZqZDs4eQwW0sFOpBY=
google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
google.golang.org/grpc/examples v0.0.0-20200731180010-8bec2f5d898f h1:HNNmM2dnxUknBEJDvuCRZcUzhGbhkz00ckV2ha2gFJY=
google.golang.org/grpc/examples v0.0.0-20200731180010-8bec2f5d898f/go.mod h1:TGiSRL2BBv2WqzfsFNWYp/pkWdtf5kbZS/DQ9Ee3mWk=
google.golang.org/grpc/security/advancedtls v0.0.0-20200902210233-8630cac324bf h1:IqdIxEnvZreeZMpDPbAA66R/PkRH6AD255RbxyuyfEY=
Expand All @@ -1276,6 +1281,9 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD
google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4=
google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c=
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
Expand Down
44 changes: 18 additions & 26 deletions tests/run-e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
set -o nounset -o pipefail -o errexit
trap "exit 1" INT

# Oasis Core release version to test against.
OASIS_RELEASE=21.1.1

# Get the root directory of the tests dir inside the repository.
ROOT="$(cd $(dirname $0); pwd -P)"

Expand All @@ -28,6 +25,16 @@ cleanup() {
}
trap "cleanup" EXIT

if [[ ! -v TEST_NODE_BINARY ]]; then
printf "${RED}### Please set \$TEST_NODE_BINARY variable.${OFF}\n"
exit 1
fi

if [[ ! -v TEST_RUNTIME_LOADER ]]; then
printf "${RED}### Please set \$TEST_RUNTIME_LOADER variable.${OFF}\n"
exit 1
fi

# Find build tools.
if [[ "$(which go)" == "" ]]; then
printf "${RED}### Please install 'go'.${OFF}\n"
Expand All @@ -38,45 +45,30 @@ if [[ "$(which cargo)" == "" ]]; then
exit 1
fi

# Find a downloader tool.
if [[ "$(which wget)" == "" ]]; then
if [[ "$(which curl)" == "" ]]; then
printf "${RED}### Please install 'wget' or 'curl'.${OFF}\n"
exit 1
else
DOWNLOAD="curl --progress-bar --location -o"
fi
else
DOWNLOAD="wget --quiet --show-progress --progress=bar:force:noscroll -O"
fi

printf "${CYAN}### Building test simple-keyvalue runtime...${OFF}\n"
cd "${ROOT}"/runtimes/simple-keyvalue
cargo build
cp "${ROOT}"/../target/debug/test-runtime-simple-keyvalue "${TEST_BASE_DIR}"/

printf "${CYAN}### Building test simple-consensus runtime...${OFF}\n"
cd "${ROOT}"/runtimes/simple-consensus
cargo build
cp "${ROOT}"/../target/debug/test-runtime-simple-consensus "${TEST_BASE_DIR}"/

printf "${CYAN}### Building e2e test harness...${OFF}\n"
cd "${ROOT}"/e2e
go build
cp "${ROOT}"/e2e/e2e "${TEST_BASE_DIR}"/

cd "${TEST_BASE_DIR}"

printf "${CYAN}### Downloading oasis-core release ${OASIS_RELEASE}...${OFF}\n"
${DOWNLOAD} oasis-core.tar.gz https://github.com/oasisprotocol/oasis-core/releases/download/v${OASIS_RELEASE}/oasis_core_${OASIS_RELEASE}_linux_amd64.tar.gz

printf "${CYAN}### Unpacking oasis-node...${OFF}\n"
${TAR} -xf oasis-core.tar.gz --strip-components=1 oasis_core_${OASIS_RELEASE}_linux_amd64/oasis-node

printf "${CYAN}### Unpacking oasis-core-runtime-loader...${OFF}\n"
${TAR} -xf oasis-core.tar.gz --strip-components=1 oasis_core_${OASIS_RELEASE}_linux_amd64/oasis-core-runtime-loader

printf "${CYAN}### Running end-to-end tests...${OFF}\n"
./e2e --log.level=INFO \
--log.format json \
--basedir.no_cleanup \
--e2e.node.binary="${TEST_BASE_DIR}"/oasis-node \
--e2e.node.binary="${TEST_NODE_BINARY}" \
--e2e.runtime.binary_dir.default="${TEST_BASE_DIR}" \
--e2e.runtime.loader="${TEST_BASE_DIR}"/oasis-core-runtime-loader
--e2e.runtime.loader="${TEST_RUNTIME_LOADER}"

cd "${ROOT}"
rm -rf "${TEST_BASE_DIR}"
Expand Down

0 comments on commit 05e4bf6

Please sign in to comment.