Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Commit

Permalink
mock: revert #838 (remove the br_test build tag)
Browse files Browse the repository at this point in the history
  • Loading branch information
kennytm committed Mar 16, 2021
1 parent 0cdeca8 commit ca53dce
Show file tree
Hide file tree
Showing 11 changed files with 4 additions and 27 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,14 @@ test: export ARGS=$$($(PACKAGES))
test:
$(PREPARE_MOD)
@make failpoint-enable
$(GOTEST) $(RACEFLAG) -tags br_test,leak $(ARGS) || ( make failpoint-disable && exit 1 )
$(GOTEST) $(RACEFLAG) -tags leak $(ARGS) || ( make failpoint-disable && exit 1 )
@make failpoint-disable

testcover: tools
mkdir -p "$(TEST_DIR)"
$(PREPARE_MOD)
@make failpoint-enable
$(GOTEST) -tags br_test -cover -covermode=count -coverprofile="$(TEST_DIR)/cov.unit.out" \
$(GOTEST) -cover -covermode=count -coverprofile="$(TEST_DIR)/cov.unit.out" \
$$($(COVERED_PACKAGES)) || ( make failpoint-disable && exit 1 )
@make failpoint-disable

Expand Down Expand Up @@ -183,7 +183,7 @@ static: prepare tools
@# exhaustivestruct - Protobuf structs have hidden fields, like "XXX_NoUnkeyedLiteral"
@# exhaustive - no need to check exhaustiveness of enum switch statements
@# gosec - too many false positive
CGO_ENABLED=0 tools/bin/golangci-lint run --enable-all --build-tags br_test --deadline 120s \
CGO_ENABLED=0 tools/bin/golangci-lint run --enable-all --deadline 120s \
--disable gochecknoglobals \
--disable goimports \
--disable gofmt \
Expand Down
2 changes: 0 additions & 2 deletions pkg/mock/backend.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions pkg/mock/dummy.go

This file was deleted.

2 changes: 0 additions & 2 deletions pkg/mock/glue.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions pkg/mock/glue_checkpoint.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions pkg/mock/importer.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions pkg/mock/mock_cluster.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// Copyright 2020 PingCAP, Inc. Licensed under Apache-2.0.

//+build br_test

package mock

import (
Expand Down
2 changes: 0 additions & 2 deletions pkg/mock/mock_cluster_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// Copyright 2020 PingCAP, Inc. Licensed under Apache-2.0.

//+build br_test

package mock_test

import (
Expand Down
2 changes: 0 additions & 2 deletions pkg/mock/s3iface.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions pkg/mock/storage.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,13 @@ You can also run unit tests directly via `go test` like:
```sh
make failpoint-enable

go test -tags br_test github.com/pingcap/br/pkg/cdclog --test.v --check.v --check.f TestColumn
# ^~~~~~~~~~~~~
go test github.com/pingcap/br/pkg/cdclog --test.v --check.v --check.f TestColumn

make failpoint-disable
```

but note that:

* the build-tag `br_test` must be enabled (this workarounds the lack of test-dependencies in go.mod)
* failpoints must be toggled manually

# Integration tests
Expand Down

0 comments on commit ca53dce

Please sign in to comment.