Skip to content
This repository has been archived by the owner on Jun 30, 2022. It is now read-only.

Commit

Permalink
Npm install client
Browse files Browse the repository at this point in the history
  • Loading branch information
armaniferrante committed Sep 6, 2019
1 parent 5ea78b3 commit 8fde17b
Show file tree
Hide file tree
Showing 3 changed files with 343 additions and 22 deletions.
37 changes: 16 additions & 21 deletions .buildkite/scripts/test_e2e.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
#!/bin/bash

############################################################
################################################################################
# This script tests the Ekiden project.
#
# Usage:
# test_e2e.sh [-w <workdir>] [-t <test-name>]
############################################################
################################################################################

# Defaults.
WORKDIR=$(pwd)
TEST_FILTER=""

#########################
# Process test arguments.
#########################
while getopts 'f:t:' arg
do
case ${arg} in
Expand All @@ -25,15 +23,14 @@ do
esac
done

export E2E_TESTS_BRANCH=master
export E2E_TESTS_BRANCH=armani/ci
export EKIDEN_REPO="https://github.com/oasislabs/ekiden.git"
export EKIDEN_BRANCH=master
export RUNTIME_BRANCH=master
export DEVELOPER_GATEWAY_BRANCH=master
export BUILDKITE_ACCESS_TOKEN="7a3c5347b067ba00750cc9a513e0d93c4fbfc293"
export RUNTIME_DIR=${WORKDIR}/runtime-ethereum

# Helpful tips on writing build scripts:
# https://buildkite.com/docs/pipelines/writing-build-scripts
set -euxo pipefail

# Setup tests.
Expand All @@ -42,6 +39,8 @@ set -euxo pipefail
.buildkite/scripts/download_ekiden_test_scripts.sh
rm -rf tests/e2e-tests



# Now begin.
source .buildkite/scripts/common.sh
source .e2e/ekiden_common_e2e.sh
Expand All @@ -52,14 +51,14 @@ source .buildkite/rust/common.sh
nvm_script="${NVM_DIR:-${HOME}/.nvm}/nvm.sh"
[ -s "${nvm_script}" ] && source "${nvm_script}"

###################
#
# Test definitions.
###################
#
run_backend_tendermint_committee_custom() {
run_backend_tendermint_committee \
epochtime_backend=tendermint_mock \
replica_group_size=3 \
runtime_genesis=${WORKDIR}/resources/genesis/ekiden_genesis_testing.json
runtime_genesis=${RUNTIME_DIR}/resources/genesis/ekiden_genesis_testing.json
}

run_no_client() {
Expand Down Expand Up @@ -90,23 +89,20 @@ scenario_basic() {
sleep 3
}


#################################
#
# Tests from e2e-tests repository
#################################
#
install_e2e_tests() {
local e2e_tests_branch=${E2E_TESTS_BRANCH:-master}

mkdir -p ${WORKDIR}/tests

echo "Installing E2E tests from e2e-tests repository."
pushd ${WORKDIR}/tests
if [ ! -d e2e-tests ]; then
git clone https://github.com/oasislabs/e2e-tests.git -b ${e2e_tests_branch} --depth 1
pushd e2e-tests
npm install > /dev/null
# Needed to install and build oasis-client within e2e-tests.
npm install -g lerna
npm install -g yarn
./scripts/oasis-client.sh
# If the Buildkite access token is available, download pre-compiled contracts
# from the e2e-tests pipeline.
if [ "${BUILDKITE:-}" == "true" ]; then
Expand Down Expand Up @@ -165,13 +161,13 @@ scenario_e2e_tests() {
popd
}

#############
#
# Test suite.
#
# Arguments:
# backend_name - name of the backend to use in test name
# backend_runner - function that will prepare and run the backend services
#############
#
test_suite() {
local backend_name=$1
local backend_runner=$2
Expand All @@ -195,7 +191,6 @@ test_suite() {
client_runner=run_no_client
}

##########################################

# Multiple validators tendermint backends.
##########################################
test_suite tm-committee run_backend_tendermint_committee_custom
Loading

0 comments on commit 8fde17b

Please sign in to comment.