Skip to content

Commit

Permalink
Unit Tests, Travis CI
Browse files Browse the repository at this point in the history
In this commit I added unit tests for the exposed API endpoint methods. I added travis CI, so that it builds each time a new commit . And I have a small fix for minikube as well. Some helper methods and ordering was needed in provenance.go, like a String() change and an ordered_map type.
  • Loading branch information
djarotech committed Dec 20, 2018
1 parent 35f9900 commit 5cca53a
Show file tree
Hide file tree
Showing 5 changed files with 803 additions and 74 deletions.
31 changes: 31 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
language: go

#omitting this line fails build bc it tries to use TLS1.0
# which bitbucket blocks so a clone will not go through
dist: xenial

# Force-enable Go modules. This will be unnecessary when Go 1.12 lands.
env:
- GO111MODULE=on

# You don't need to test on very old version of the Go compiler. It's the user's
# responsibility to keep their compilers up to date.
go:
- 1.11.x

# Only clone the most recent commit.
git:
depth: 1

# Skip the install step. Don't `go get` dependencies. Only build with the code
# in vendor/
install: true

# email me results if a test fails.
notifications:
recipients:
- [email protected]
on_success: never
on_failure: always
script:
- go test -v ./...
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ apt-get install -y gcc make socat git wget<br/>
wget https://dl.google.com/go/go1.10.3.linux-amd64.tar.gz <br/>
sudo tar -C /usr/local -xzf go1.10.3.linux-amd64.tar.gz <br/>
export PATH=$PATH:/usr/local/go/bin <br/>
export GOROOT=$PATH:/usr/local/go <br/>
export GOROOT=/usr/local/go <br/>

Set up your Go workspace, set the GOPATH to it. This is where all your Go code should be. <br/>
mkdir $HOME/goworkspace <br/>
Expand Down Expand Up @@ -192,7 +192,7 @@ minikube ip -- verify that minikube is up and running <br/>
wget https://dl.google.com/go/go1.10.3.linux-amd64.tar.gz <br/>
sudo tar -C /usr/local -xzf go1.10.3.linux-amd64.tar.gz <br/>
export PATH=$PATH:/usr/local/go/bin <br/>
export GOROOT=$PATH:/usr/local/go <br/>
export GOROOT=/usr/local/go <br/>

Set up your Go workspace, set the GOPATH to it. This is where all your Go code should be. <br/>
mkdir $HOME/goworkspace <br/>
Expand Down Expand Up @@ -284,6 +284,12 @@ kubectl get --raw "/apis/kubeprovenance.cloudark.io/v1/namespaces/default/postgr
```
![alt text](https://github.com/cloud-ark/kubeprovenance/raw/master/docs/bisect.png)


## Running Unit Tests:

1. go test -v ./...


## Troubleshooting tips:

1) Check that the API server Pod is running:
Expand Down
Loading

0 comments on commit 5cca53a

Please sign in to comment.