Skip to content
This repository has been archived by the owner on Oct 4, 2019. It is now read-only.

Commit

Permalink
Unit tests with and without SputnikVM
Browse files Browse the repository at this point in the history
  • Loading branch information
tzdybal committed Aug 29, 2018
1 parent 6a409d0 commit 855f274
Showing 1 changed file with 41 additions and 12 deletions.
53 changes: 41 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,21 @@ unit_tests_steps: &unit_tests_steps
export GOPATH=$HOME/go
export GOBIN=$GOPATH/bin
export PATH=$PATH:$GOBIN
export CGO_LDFLAGS="$GOPATH/src/github.com/ethereumproject/go-ethereum/vendor/github.com/ethereumproject/sputnikvm-ffi/c/libsputnikvm.a -ldl"
if [ "$(uname)" == "Darwin" ]; then
export CGO_LDFLAGS="$CGO_LDFLAGS -lresolv"
export TAGS="netgo deterministic"
if [ $USE_SPUTNIK_VM == true ]; then
export CGO_LDFLAGS="$GOPATH/src/github.com/ethereumproject/go-ethereum/vendor/github.com/ethereumproject/sputnikvm-ffi/c/libsputnikvm.a -ldl"
if [ "$(uname)" == "Darwin" ]; then
export CGO_LDFLAGS="$CGO_LDFLAGS -lresolv"
fi
export TAGS="sputnikvm $TAGS"
fi
export PATH=$PATH:$HOME/.cargo/bin:$HOME/janusbin
cd $GOPATH/src/github.com/ethereumproject/go-ethereum
go env
# Since core/ and tests/ packages are run deterministically, we can safely
# infer that SputnikVM is functioning the same as the native VM without running
# the schroedinger nondeterministic tests with sputnik enabled.
go test -tags="netgo deterministic" ./...
go test -ldflags "-X github.com/ethereumproject/go-ethereum/core.UseSputnikVM=true" -tags="sputnikvm netgo deterministic" ./...
go test -ldflags "-X github.com/ethereumproject/go-ethereum/core.UseSputnikVM=$USE_SPUTNIK_VM" -tags="$TAGS" ./...
schroedinger -t 5 -f ./schroedinger-tests.txt
bats_tests_steps: &bats_tests_steps
Expand Down Expand Up @@ -192,16 +195,34 @@ jobs:
- image: circleci/golang:1.9
<<: *sputnik_vm_steps

mac_unit_tests:
mac_evm_unit_tests:
macos:
xcode: "9.0"
environment:
USE_SPUTNIK_VM: false
<<: *unit_tests_steps

linux_unit_tests:
linux_evm_unit_tests:
docker:
- image: circleci/golang:1.9
environment:
GOMAXPROCS: 2
environment:
GOMAXPROCS: 2
USE_SPUTNIK_VM: false
<<: *unit_tests_steps

mac_sputnikvm_unit_tests:
macos:
xcode: "9.0"
environment:
USE_SPUTNIK_VM: true
<<: *unit_tests_steps

linux_sputnikvm_unit_tests:
docker:
- image: circleci/golang:1.9
environment:
GOMAXPROCS: 2
USE_SPUTNIK_VM: true
<<: *unit_tests_steps

mac_bats_tests:
Expand Down Expand Up @@ -238,7 +259,13 @@ workflows:
filters:
tags:
only: /.*/
- mac_unit_tests:
- mac_evm_unit_tests:
requires:
- mac_sputnik_vm
filters:
tags:
only: /.*/
- mac_sputnikvm_unit_tests:
requires:
- mac_sputnik_vm
filters:
Expand All @@ -252,7 +279,8 @@ workflows:
only: /.*/
- mac_deploy:
requires:
- mac_unit_tests
- mac_evm_unit_tests
- mac_sputnikvm_unit_tests
- mac_bats_tests
filters:
branches:
Expand Down Expand Up @@ -286,7 +314,8 @@ workflows:
only: /.*/
- linux_deploy:
requires:
- linux_unit_tests
- linux_evm_unit_tests
- linux_sputnikvm_unit_tests
- linux_bats_tests
filters:
branches:
Expand Down

0 comments on commit 855f274

Please sign in to comment.