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

cherrypick-1.1: build: separate out race logic tests #20542

Merged
merged 1 commit into from
Dec 6, 2017
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
14 changes: 14 additions & 0 deletions build/teamcity-testlogicrace.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash
set -euxo pipefail

export BUILDER_HIDE_GOPATH_SRC=1

mkdir -p artifacts

build/builder.sh env \
make testrace \
PKG=./pkg/sql/logictest
TESTFLAGS='-v' \
2>&1 \
| tee artifacts/testlogicrace.log \
| go-test-teamcity
1 change: 1 addition & 0 deletions build/teamcity-testrace.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ build/builder.sh env \
github-pull-request-make

build/builder.sh env \
COCKROACH_LOGIC_TESTS_SKIP=true \
make testrace \
TESTFLAGS='-v' \
2>&1 \
Expand Down
15 changes: 15 additions & 0 deletions pkg/sql/logictest/logic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ import (
"github.com/cockroachdb/cockroach/pkg/testutils/distsqlutils"
"github.com/cockroachdb/cockroach/pkg/testutils/serverutils"
"github.com/cockroachdb/cockroach/pkg/testutils/sqlutils"
"github.com/cockroachdb/cockroach/pkg/util/envutil"
"github.com/cockroachdb/cockroach/pkg/util/leaktest"
"github.com/cockroachdb/cockroach/pkg/util/log"
"github.com/cockroachdb/cockroach/pkg/util/syncutil"
Expand Down Expand Up @@ -1499,6 +1500,10 @@ func (t *logicTest) runFile(path string, config testClusterConfig) {
t.outf("file %s done with config: %s", path, config.name)
}

var skipLogicTests = envutil.EnvOrDefaultBool("COCKROACH_LOGIC_TESTS_SKIP", false)
var logicTestsConfigExclude = envutil.EnvOrDefaultString("COCKROACH_LOGIC_TESTS_SKIP_CONFIG", "")
var logicTestsConfigFilter = envutil.EnvOrDefaultString("COCKROACH_LOGIC_TESTS_CONFIG", "")

func TestLogic(t *testing.T) {
defer leaktest.AfterTest(t)()

Expand All @@ -1507,6 +1512,10 @@ func TestLogic(t *testing.T) {
t.Skip()
}

if skipLogicTests {
t.Skip("COCKROACH_LOGIC_TESTS_SKIP")
}

// run the logic tests indicated by the bigtest and logictestdata flags.
// A new cluster is set up for each separate file in the test.
var globs []string
Expand Down Expand Up @@ -1596,6 +1605,12 @@ func TestLogic(t *testing.T) {
}
// Top-level test: one per test configuration.
t.Run(cfg.name, func(t *testing.T) {
if logicTestsConfigExclude != "" && cfg.name == logicTestsConfigExclude {
t.Skip("config excluded via env var")
}
if logicTestsConfigFilter != "" && cfg.name != logicTestsConfigFilter {
t.Skip("config does not match env var")
}
for _, path := range paths {
path := path // Rebind range variable.
// Inner test: one per file path.
Expand Down