From 05e4bf6700479fb3a94806672e2cdb6a56d7a567 Mon Sep 17 00:00:00 2001 From: ptrus Date: Fri, 23 Apr 2021 14:58:57 +0200 Subject: [PATCH] tests: setup consensus module e2e tests --- .github/workflows/ci-test.yaml | 21 +++++++++ client-sdk/ts-web/core/.gitignore | 1 + .../core/playground/download-artifacts.sh | 12 +---- .../core/playground/sample-run-network.sh | 8 ++-- client-sdk/ts-web/rt/.gitignore | 1 + client-sdk/ts-web/rt/playground/consts.sh | 12 +++-- .../rt/playground/download-artifacts.sh | 19 +++----- .../rt/playground/sample-run-network.sh | 15 ++++--- tests/.gitignore | 1 + tests/consts.sh | 5 +++ tests/download-artifacts.sh | 22 ++++++++++ tests/e2e/go.mod | 4 +- tests/e2e/go.sum | 30 ++++++++----- tests/run-e2e.sh | 44 ++++++++----------- 14 files changed, 117 insertions(+), 78 deletions(-) create mode 100644 tests/.gitignore create mode 100644 tests/consts.sh create mode 100755 tests/download-artifacts.sh diff --git a/.github/workflows/ci-test.yaml b/.github/workflows/ci-test.yaml index 8caf16fce4..b94c20a8bb 100644 --- a/.github/workflows/ci-test.yaml +++ b/.github/workflows/ci-test.yaml @@ -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 @@ -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 @@ -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 @@ -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" diff --git a/client-sdk/ts-web/core/.gitignore b/client-sdk/ts-web/core/.gitignore index 6628c243ab..18d3f041c6 100644 --- a/client-sdk/ts-web/core/.gitignore +++ b/client-sdk/ts-web/core/.gitignore @@ -4,3 +4,4 @@ /node_modules /playground/dist/main.js /playground/untracked +package-lock.json diff --git a/client-sdk/ts-web/core/playground/download-artifacts.sh b/client-sdk/ts-web/core/playground/download-artifacts.sh index 487f3db057..119671b986 100755 --- a/client-sdk/ts-web/core/playground/download-artifacts.sh +++ b/client-sdk/ts-web/core/playground/download-artifacts.sh @@ -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 diff --git a/client-sdk/ts-web/core/playground/sample-run-network.sh b/client-sdk/ts-web/core/playground/sample-run-network.sh index 7ed17e3a83..e9eeada091 100755 --- a/client-sdk/ts-web/core/playground/sample-run-network.sh +++ b/client-sdk/ts-web/core/playground/sample-run-network.sh @@ -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 diff --git a/client-sdk/ts-web/rt/.gitignore b/client-sdk/ts-web/rt/.gitignore index 6628c243ab..18d3f041c6 100644 --- a/client-sdk/ts-web/rt/.gitignore +++ b/client-sdk/ts-web/rt/.gitignore @@ -4,3 +4,4 @@ /node_modules /playground/dist/main.js /playground/untracked +package-lock.json diff --git a/client-sdk/ts-web/rt/playground/consts.sh b/client-sdk/ts-web/rt/playground/consts.sh index 48da7dc587..20e21d54c2 100644 --- a/client-sdk/ts-web/rt/playground/consts.sh +++ b/client-sdk/ts-web/rt/playground/consts.sh @@ -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 diff --git a/client-sdk/ts-web/rt/playground/download-artifacts.sh b/client-sdk/ts-web/rt/playground/download-artifacts.sh index 620330f4bb..24ea43fc6b 100755 --- a/client-sdk/ts-web/rt/playground/download-artifacts.sh +++ b/client-sdk/ts-web/rt/playground/download-artifacts.sh @@ -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 diff --git a/client-sdk/ts-web/rt/playground/sample-run-network.sh b/client-sdk/ts-web/rt/playground/sample-run-network.sh index 90aa014a09..5f15901ce3 100755 --- a/client-sdk/ts-web/rt/playground/sample-run-network.sh +++ b/client-sdk/ts-web/rt/playground/sample-run-network.sh @@ -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 diff --git a/tests/.gitignore b/tests/.gitignore new file mode 100644 index 0000000000..5a72eb2edc --- /dev/null +++ b/tests/.gitignore @@ -0,0 +1 @@ +untracked diff --git a/tests/consts.sh b/tests/consts.sh new file mode 100644 index 0000000000..b2e2e52881 --- /dev/null +++ b/tests/consts.sh @@ -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 diff --git a/tests/download-artifacts.sh b/tests/download-artifacts.sh new file mode 100755 index 0000000000..906b8e3abf --- /dev/null +++ b/tests/download-artifacts.sh @@ -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 diff --git a/tests/e2e/go.mod b/tests/e2e/go.mod index eb883be779..d516618599 100644 --- a/tests/e2e/go.mod +++ b/tests/e2e/go.mod @@ -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 ) diff --git a/tests/e2e/go.sum b/tests/e2e/go.sum index efaf46ca43..9c80e8fd2a 100644 --- a/tests/e2e/go.sum +++ b/tests/e2e/go.sum @@ -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= @@ -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= @@ -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= @@ -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= @@ -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= @@ -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= @@ -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= @@ -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= diff --git a/tests/run-e2e.sh b/tests/run-e2e.sh index 748c05b237..2281d81b69 100755 --- a/tests/run-e2e.sh +++ b/tests/run-e2e.sh @@ -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)" @@ -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" @@ -38,23 +45,16 @@ 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 @@ -62,21 +62,13 @@ 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}"