Skip to content

Commit

Permalink
ci: add tests with data race detector
Browse files Browse the repository at this point in the history
Tests execution result may differ due to different timings, so it is
better to test together, rather than instead.

Closes #218
  • Loading branch information
oleg-jukovec committed Jan 16, 2023
1 parent 9ec8350 commit ba53a95
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 4 deletions.
20 changes: 16 additions & 4 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,24 @@ jobs:
run: make deps

- name: Run regression tests
run: make test
run: |
make test
make testrace
- name: Run regression tests with call_17
run: make test TAGS="go_tarantool_call_17"
run: |
make test TAGS="go_tarantool_call_17"
make testrace TAGS="go_tarantool_call_17"
- name: Run regression tests with msgpack.v5
run: make test TAGS="go_tarantool_msgpack_v5"
run: |
make test TAGS="go_tarantool_msgpack_v5"
make testrace TAGS="go_tarantool_msgpack_v5"
- name: Run regression tests with msgpack.v5 and call_17
run: make test TAGS="go_tarantool_msgpack_v5,go_tarantool_call_17"
run: |
make test TAGS="go_tarantool_msgpack_v5,go_tarantool_call_17"
make testrace TAGS="go_tarantool_msgpack_v5,go_tarantool_call_17"
- name: Run fuzzing tests
if: ${{ matrix.fuzzing }}
Expand Down Expand Up @@ -189,27 +197,31 @@ jobs:
run: |
source tarantool-enterprise/env.sh
make test
make testrace
env:
TEST_TNT_SSL: ${{matrix.ssl}}

- name: Run regression tests with call_17
run: |
source tarantool-enterprise/env.sh
make test TAGS="go_tarantool_call_17"
make testrace TAGS="go_tarantool_call_17"
env:
TEST_TNT_SSL: ${{matrix.ssl}}

- name: Run regression tests with msgpack.v5
run: |
source tarantool-enterprise/env.sh
make test TAGS="go_tarantool_msgpack_v5"
make testrace TAGS="go_tarantool_msgpack_v5"
env:
TEST_TNT_SSL: ${{matrix.ssl}}

- name: Run regression tests with msgpack.v5 and call_17
run: |
source tarantool-enterprise/env.sh
make test TAGS="go_tarantool_msgpack_v5,go_tarantool_call_17"
make testrace TAGS="go_tarantool_msgpack_v5,go_tarantool_call_17"
env:
TEST_TNT_SSL: ${{matrix.ssl}}

Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,14 @@ Versioning](http://semver.org/spec/v2.0.0.html) except to the first release.
### Added

- Support pagination (#246)
- A Makefile target to test with race detector (#218)

### Changed

### Fixed

- Several non-critical data race issues (#218)

## [1.10.0] - 2022-12-31

The release improves compatibility with new Tarantool versions.
Expand Down
7 changes: 7 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,26 @@ To run tests for the main package and each subpackage:
make test
```

To run tests for the main package and each subpackage with race detector:
```bash
make testrace
```

The tests set up all required `tarantool` processes before run and clean up
afterwards.

If you want to run the tests with specific build tags:
```bash
make test TAGS=go_tarantool_ssl_disable,go_tarantool_msgpack_v5
make testrace TAGS=go_tarantool_ssl_disable,go_tarantool_msgpack_v5
```

If you have Tarantool Enterprise Edition 2.10 or newer, you can run additional
SSL tests. To do this, you need to set an environment variable 'TEST_TNT_SSL':

```bash
TEST_TNT_SSL=true make test
TEST_TNT_SSL=true make testrace
```

If you want to run the tests for a specific package:
Expand Down
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ test:
testdata:
(cd ./testdata; ./generate.sh)

.PHONY: testrace
testrace:
@echo "Running all packages tests with data race detector"
go clean -testcache
go test -race -tags "$(TAGS)" ./... -v -p 1

.PHONY: test-connection-pool
test-connection-pool:
@echo "Running tests in connection_pool package"
Expand Down

0 comments on commit ba53a95

Please sign in to comment.