Skip to content

Commit

Permalink
update ci coverage step to use workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
stackdump committed Mar 1, 2019
1 parent 3f8fadb commit 84ccd20
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 47 deletions.
60 changes: 14 additions & 46 deletions .circleci/config.yml
Expand Up @@ -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
Expand Down
15 changes: 14 additions & 1 deletion 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
```
13 changes: 13 additions & 0 deletions 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/...
``

0 comments on commit 84ccd20

Please sign in to comment.