github.com/zaquestion/lab@v0.25.1/CONTRIBUTING.md (about)

     1  
     2  ## Project Goals
     3  
     4  *lab* is fundamentally a workflow tool; we don't add features just to cover the API.
     5  Instead, we add them to support and improve our cli workflows, which we want to flow seamlessly and feel intuitive and natural.
     6  
     7  ## Overview of Tests
     8  
     9  *lab* runs integration tests in addition to unit tests. The integration tests run against [gitlab.com](https://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.test` 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).
    10  
    11  ## Setup and Prerequestites
    12  
    13  **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*.
    14  
    15  To run the *lab* tests, you will need:
    16  1. `go` and `git` must be installed (optionally `make`)
    17  2. 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.
    18  3. The `GOPATH` environment variable needs to be explicitly set. (eg `export GOPATH=$(go env GOPATH)`)
    19  4. Add `$GOPATH/bin` to your `$PATH`.
    20  5. The `GO111MODULE` environment variable needs to be set to `on`. (eg `export GO111MODULE=on`)
    21  6. The tests assume that the lab source repo is located in `$GOPATH/src/github.com/zaquestion/lab`
    22  
    23  ## Running Tests
    24  Tests can be run via `make test`:
    25  
    26  ```sh
    27  $ cd $GOPATH/src/github.com/zaquestion/lab
    28  
    29  # run all tests
    30  $ make test
    31  
    32  # run only tests matching "pattern"
    33  $ make test run=pattern
    34  ```
    35  
    36  or with `go test`:
    37  
    38  ```sh
    39  $ cd $GOPATH/src/github.com/zaquestion/lab
    40  
    41  $ GO111MODULE=on go test ./cmd ./internal/...
    42  ```