Skip to content

Commit

Permalink
docs: document how to run tests (close #239)
Browse files Browse the repository at this point in the history
  • Loading branch information
claytonrcarter committed Nov 12, 2018
1 parent 183d0ff commit 509a801
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 3 deletions.
36 changes: 33 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,34 @@
Workflow oriented and purpose driven. We aren't trying to do all the things in every way.

atomic/seamless command structure -- flowing between commands should be intuitive and feel second nature
The documentation needs love and I'm no worder, please save us all!
## Project Goals

lab is fundamentally a workflow tool; we don't add features just to cover the API.
Instead, we add them to support and improve our cli workflows, which we want to flow seamlessly and feel intuitive and natural.

## Test Overview

lab runs integration tests in addition to unit tests. The integration tests run against gitlab.com. We are willing to trade some test autonomy and speed in exchange for 100% guarantees that features work against a live GitLab API. Integration tests are largely identified as tests which execute the `./lab_bin` binary. There are two primary projects used for these integration tests: [zaquestion/test](https://gitlab.com/zaquestion/test) and [lab-testing/test](https://gitlab.com/lab-testing/test).

## Setup and Prerequestites

**New to Go?** Check out the Go docs on [How to Write Go Code](https://golang.org/doc/code.html) for some background on Go coding conventions, many of which are used by lab.

To run the lab tests, you will need:
1. A gitlab.com account configured with an [SSH key](https://docs.gitlab.com/ce/ssh/README.html#adding-an-ssh-key-to-your-gitlab-account). If you can push and pull from gitlab.com remotes, you're probably all set.
2. The `GOPATH` environment variable needs to be explicitly set. (eg `export GOPATH=$(go env GOPATH)`)
3. Add `$GOPATH/bin` to your `$PATH`.
3. The `GO111MODULE` environment variable needs to be set to `on`. (eg `export GO111MODULE=on`)
4. The tests assume that the lab source repo is located in `$GOPATH/src/github.com/zaquestion/lab`
4. It should go without saying, but you'll also need `go`, `git` and `make` installed.

## Running Tests
In order to setup the integration test data, the tests must be run via `make test`:

```sh
$ cd $GOPATH/src/github.com/zaquestion/lab

# run all tests
$ make test

# run only tests matching "pattern"
$ make test run=pattern
```
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ or
make install
```

### Tests
See the [contribution guide](CONTRIBUTING.md).

# Configuration

`lab` needs your GitLab information in order to interact with to your GitLab
Expand Down

0 comments on commit 509a801

Please sign in to comment.