Skip to content

Commit

Permalink
Fix documentation for running tests
Browse files Browse the repository at this point in the history
  • Loading branch information
akshat committed Sep 24, 2018
1 parent 8e5e681 commit a9d3225
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 8 deletions.
20 changes: 20 additions & 0 deletions .env.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
export PROCTOR_KUBE_CONFIG="out-of-cluster"
export PROCTOR_LOG_LEVEL="debug"
export PROCTOR_APP_PORT="5000"
export PROCTOR_DEFAULT_NAMESPACE="default"
export PROCTOR_REDIS_ADDRESS="localhost:6379"
export PROCTOR_REDIS_MAX_ACTIVE_CONNECTIONS="10"
export PROCTOR_KUBE_JOB_ACTIVE_DEADLINE_SECONDS="60"
export PROCTOR_LOGS_STREAM_READ_BUFFER_SIZE="140"
export PROCTOR_LOGS_STREAM_WRITE_BUFFER_SIZE="4096"
export PROCTOR_KUBE_CLUSTER_HOST_NAME="localhost:8001"
export PROCTOR_KUBE_POD_LIST_WAIT_TIME="5"
export PROCTOR_KUBE_CA_CERT_ENCODED="LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCmNlcnRpZmljYXRlCi0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K"
export PROCTOR_KUBE_BASIC_AUTH="YWRtaW46cGFzc3dvcmQK"
export PROCTOR_POSTGRES_USER="postgres"
export PROCTOR_POSTGRES_PASSWORD=""
export PROCTOR_POSTGRES_HOST="localhost"
export PROCTOR_POSTGRES_PORT="5432"
export PROCTOR_POSTGRES_DATABASE="proctord_test"
export PROCTOR_POSTGRES_MAX_CONNECTIONS="50"
export PROCTOR_POSTGRES_CONNECTIONS_MAX_LIFETIME="30"
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ jobs:
include:
- stage: test
script:
# testing proctord
# setting up proctord
- cd proctord/
- glide install
- go build
- ./proctord migrate
- go test -race -cover $(glide novendor)
# testing proctor cli
# setting up proctor-cli
- cd ../.
- glide install
- go test -race -cover ./cmd/... ./config/... ./io/... ./procs/... ./engine/... .
# testing both proctor-cli and proctord
- go test -race -cover $(glide novendor)
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,12 @@ Users can use it to run procs.
* Running `go install github.com/gojektech/proctor` will place the CLI binary in your `$GOPATH/bin` directory
* Run `proctor version` to check installation

### Running tests instructions
### Running tests

* [Setup dev environment](#dev-environment-setup)
* `cd proctord`. Refer README to setup test environment of proctord
* After setting up test env for proctord, `cd ..`
* Configure environment variables `source .env.test`
* Run tests: `go test -race -cover $(glide novendor)`

#### Proctor CLI configuration
Expand Down
5 changes: 2 additions & 3 deletions proctord/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@
### Running tests

* [Setup dev environment](#dev-environment-setup)
* Use `.env.test` file to configure test environment
* Create database `proctord_test`
* Run database migrations by running this command `./proctord migrate` from the repo directory
* Use `.env.test` file to configure environment variables for running test
* Setup database `make db.setup`
* Run tests: `go test -race -cover $(glide novendor)`

#### proctord configuration
Expand Down

0 comments on commit a9d3225

Please sign in to comment.