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

allow selecting test granularity using make #350

Merged
merged 2 commits into from
Sep 8, 2022
Merged
Show file tree
Hide file tree
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
17 changes: 17 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,26 @@ install: go.sum
go install $(BUILD_FLAGS) ./cmd/interchain-security-pd
go install $(BUILD_FLAGS) ./cmd/interchain-security-cd

# run all tests: unit, e2e and diff
test:
go test ./...

# run e2e and unit tests
test-short:
go test ./tests/e2e/... ./x/... ./app/...

# run difference tests
test-diff:
go test ./tests/difference/...

# run integration tests
test-integration:
go run ./tests/integration/...

# run all tests with caching disabled
test-no-cache:
go test ./... -count=1

BUILD_TARGETS := build

build: BUILD_ARGS=-o $(BUILDDIR)/
Expand Down
21 changes: 18 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,27 @@ Similar to e2e tests, but they compare the system state to an expected state gen
[Integration tests](./tests/integration/) run true consumer and provider chain binaries within a docker container and are relevant to the highest level of functionality. Integration tests use queries/transactions invoked from CLI to drive and validate the code.

### Running Tests
Tests can be run using `make`:

```bash
# run all static analysis, unit, e2e, and integration tests using make
TODO
# run all unit and e2e tests using make
# run unit, e2e, and integration tests
make test

# run unit and e2e tests - prefer this for local development
make test-short

# run difference tests
make test-diff

# run integration tests
make test-integration

# equivalent to make test with caching disabled
make test-no-cache
```

Alternatively you can run tests using `go test`:
```bash
# run all unit and e2e tests using go
go test ./...
# run all unit and e2e tests with verbose output
Expand Down