Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: improve readme tests section #2380

Merged
merged 2 commits into from
Mar 8, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 32 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -435,18 +435,48 @@ There are three types of tests you can run:
- Regular tests (do require PostgreSQL, MySQL, CockroachDB)
- End to end tests (do require databases and will use a test browser)

All of the above tests can be run using the makefile. See the commands below.

**Makefile commands**

```shell
# quick tests
make quicktest

# regular tests
make test
test-resetdb

# end-to-end tests
make e2e
```

##### Short Tests

It is recommended to use the make file to run your tests using `make quicktest`
, however, you can still use the `go test` command.

**Please note**:

All tests run against a sqlite in-memory database,
thus it is required to use the `-tags sqlite` build tag.

Short tests run fairly quickly. You can either test all of the code at once:

```shell script
go test -short ./...
go test -v -failfast -short -tags sqlite ./...
```

or test just a specific module:

```shell script
cd client; go test -short .
go test -v -failfast -short -tags sqlite ./client
```

or a specific test:

```shell script
go test -v -failfast -short -tags sqlite -run ^TestName$ ./...
```

##### Regular Tests
Expand Down