Skip to content

Commit

Permalink
github-ci: add tests for msgpack.v5
Browse files Browse the repository at this point in the history
Closes #124
  • Loading branch information
oleg-jukovec committed Jun 8, 2022
1 parent 1204fc8 commit 3bb200d
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 9 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ jobs:
- name: Run tests
run: make test

- name: Run tests with msgpack.v5
run: make test TAGS="go_tarantool_msgpack_v5"

- name: Run tests, collect code coverage data and send to Coveralls
if: ${{ matrix.coveralls }}
env:
Expand Down Expand Up @@ -134,6 +137,13 @@ jobs:
env:
TEST_TNT_SSL: ${{matrix.ssl}}

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

- name: Run tests, collect code coverage data and send to Coveralls
if: ${{ matrix.coveralls }}
env:
Expand Down
5 changes: 5 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ make test
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
```

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':

Expand Down
19 changes: 10 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ BENCH_REFERENCE_REPO := ${BENCH_PATH}/go-tarantool
BENCH_OPTIONS := -bench=. -run=^Benchmark -benchmem -benchtime=${DURATION} -count=${COUNT}
GO_TARANTOOL_URL := https://github.com/tarantool/go-tarantool
GO_TARANTOOL_DIR := ${PROJECT_DIR}/${BENCH_PATH}/go-tarantool
TAGS :=

.PHONY: clean
clean:
Expand All @@ -33,7 +34,7 @@ golangci-lint:

.PHONY: test
test:
go test ./... -v -p 1
go test -tags "$(TAGS)" ./... -v -p 1

.PHONY: testdata
testdata:
Expand All @@ -43,38 +44,38 @@ testdata:
test-connection-pool:
@echo "Running tests in connection_pool package"
go clean -testcache
go test ./connection_pool/ -v -p 1
go test -tags "$(TAGS)" ./connection_pool/ -v -p 1

.PHONY: test-multi
test-multi:
@echo "Running tests in multiconnection package"
go clean -testcache
go test ./multi/ -v -p 1
go test -tags "$(TAGS)" ./multi/ -v -p 1

.PHONY: test-queue
test-queue:
@echo "Running tests in queue package"
cd ./queue/ && tarantool -e "require('queue')"
go clean -testcache
go test ./queue/ -v -p 1
go test -tags "$(TAGS)" ./queue/ -v -p 1

.PHONY: test-uuid
test-uuid:
@echo "Running tests in UUID package"
go clean -testcache
go test ./uuid/ -v -p 1
go test -tags "$(TAGS)" ./uuid/ -v -p 1

.PHONY: test-main
test-main:
@echo "Running tests in main package"
go clean -testcache
go test . -v -p 1
go test -tags "$(TAGS)" . -v -p 1

.PHONY: coverage
coverage:
go clean -testcache
go get golang.org/x/tools/cmd/cover
go test ./... -v -p 1 -covermode=atomic -coverprofile=$(COVERAGE_FILE) -coverpkg=./...
go test -tags "$(TAGS)" ./... -v -p 1 -covermode=atomic -coverprofile=$(COVERAGE_FILE) -coverpkg=./...
go tool cover -func=$(COVERAGE_FILE)

.PHONY: coveralls
Expand All @@ -94,7 +95,7 @@ ${BENCH_PATH} bench-deps:
.PHONY: bench
${BENCH_FILE} bench: ${BENCH_PATH}
@echo "Running benchmark tests from the current branch"
go test ${TEST_PATH} ${BENCH_OPTIONS} 2>&1 \
go test -tags "$(TAGS)" ${TEST_PATH} ${BENCH_OPTIONS} 2>&1 \
| tee ${BENCH_FILE}
benchstat ${BENCH_FILE}

Expand All @@ -104,7 +105,7 @@ ${GO_TARANTOOL_DIR}:

${REFERENCE_FILE}: ${GO_TARANTOOL_DIR}
@echo "Running benchmark tests from master for using results in bench-diff target"
cd ${GO_TARANTOOL_DIR} && git pull && go test ./... ${BENCH_OPTIONS} 2>&1 \
cd ${GO_TARANTOOL_DIR} && git pull && go test -tags $(TAGS) ./... ${BENCH_OPTIONS} 2>&1 \
| tee ${REFERENCE_FILE}

bench-diff: ${BENCH_FILES}
Expand Down

0 comments on commit 3bb200d

Please sign in to comment.