From 84ccd208b25dc8d1374d0dd65927750459b3539a Mon Sep 17 00:00:00 2001 From: stackdump Date: Fri, 22 Feb 2019 15:22:58 -0600 Subject: [PATCH] update ci coverage step to use workspace --- .circleci/config.yml | 60 +++++++++++--------------------------------- peerTest/README.md | 15 ++++++++++- simTest/README.md | 13 ++++++++++ 3 files changed, 41 insertions(+), 47 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2a60d634aa..5e359009ca 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -59,62 +59,30 @@ jobs: - run: name: Run Tests! no_output_timeout: 2400 - command: PATH="/tmp/go/bin:$PATH" GOPATH=/tmp/go /tmp/go/src/github.com/FactomProject/factomd/test.sh sim + command: | + export PATH="/tmp/go/bin:$PATH" + export GOPATH=/tmp/go + cd /tmp/go/src/github.com/FactomProject/factomd/ + ./test.sh coveralls: - working_directory: /go/src/github.com/FactomProject/factomd + working_directory: /tmp docker: - image: circleci/golang:1.10 steps: - - checkout - - - restore_cache: - keys: - - v2-factomd-go-build-cache-{{ checksum "glide.lock" }} - - - run: - name: Get glide - command: | - go get -v github.com/Masterminds/glide - cd $GOPATH/src/github.com/Masterminds/glide - git checkout tags/v0.13.1 - go install - - run: - name: Get goveralls - command: | - go get github.com/mattn/goveralls - cd $GOPATH/src/github.com/Masterminds/glide - git checkout tags/v0.13.1 - go install - - run: - name: Get the dependencies - command: | - glide install - - run: - name: Build and install the executable - command: go install -v + - attach_workspace: + at: /tmp - run: name: Go Test with Coverage no_output_timeout: 2400 - command: go test $(glide nv | grep -v Utilities | grep -v longTest | grep -v peerTest | grep -v simTest) -vet=off -v -cover -coverprofile=coverage.out - - - run: - name: Coveralls! - no_output_timeout: 2400 - command: goveralls -coverprofile=coverage.out -service=circle-ci -repotoken=$COVERALLS_TOKEN - -# - run: -# name: Coveralls! -# no_output_timeout: 2400 -# command: goveralls -v -flags "-vet=off" -ignore=$(paste -sd, .coverignore) -service=circle-ci -repotoken=$COVERALLS_TOKEN - - - - save_cache: - key: v2-factomd-go-build-cache-{{ checksum "glide.lock" }} - paths: - - vendor + command: | + export PATH="/tmp/go/bin:$PATH" + export GOPATH=/tmp/go + cd /tmp/go/src/github.com/FactomProject/factomd/ + go test $(glide nv | grep -v Utilities | grep -v longTest | grep -v peerTest | grep -v simTest) -vet=off -v -cover -coverprofile=coverage.out + goveralls -coverprofile=coverage.out -service=circle-ci -repotoken=$COVERALLS_TOKEN # Docker builds diff --git a/peerTest/README.md b/peerTest/README.md index 5a3c058fb6..5cd7354a77 100644 --- a/peerTest/README.md +++ b/peerTest/README.md @@ -1,8 +1,21 @@ # factomd/peerTest -This folder contains tests that must be run in parallel. +This folder contains tests that must be run in parallel (2 tests at a time). These tests are useful for testing features between builds by running 1 of each pair from previous/current builds. Tests in this folder will *not run* on circle.ci + + +## BrainSwap + +Run these two tests simultaneously to observe +an identy swap between go processes. + +These two tests are configured to be peers. + +``` +nohup go test -v BrainSwapFollower_test.go & +go test -v BrainSwapNetwork_test.go +``` diff --git a/simTest/README.md b/simTest/README.md index 5c4d23c641..8e720259a1 100644 --- a/simTest/README.md +++ b/simTest/README.md @@ -1,4 +1,17 @@ # factomd/simTest This folder contains simulation tests that can run alone in isolation. + Tests in this folder will also run on circle.ci + +NOTE: each `_test.go` file in this folder should be able to be run by itself + +EX: +``` + go test -v ./simTest/BrainSwap_test.go +``` + +This is in contrast to testing by module (as we do with other types of unit tests) +``` +go test -v ./engine/... +``