-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Building and running tests
kena edited this page Feb 14, 2018
·
10 revisions
To build and run tests, just run
make
To run just presubmit checks (golint
etc):
make check
Running the tests for a package:
make test PKG=./sql
Verbose test output:
make test PKG=./sql TESTFLAGS='-v'
Finding a test that fails:
make test PKG=./sql TESTFLAGS='-v' | grep FAIL
Running tests, showing which tests are run and test failures but not the CockroachDB log details:
make test PKG=./sql TESTFLAGS='-v -logtostderr NONE'
Running a particular test:
make test PKG=./sql TESTS=Logic
Running the SQL logic tests:
make testlogic
Running a subtest of the logic test:
make testlogic FILES="show_trace explain"
Changing the expected output of SQL logic tests:
make testLOGIC FILES="..." TESTFLAGS=-rewrite-results-in-testfiles
Running the sql logic test with the bigtest datasets:
$ cd sql
$ cat Makefile
.PHONY: bigtest
bigtest:
go test -bigtest -timeout 24h -run '^TestLogic$$'
$ make
Finding commit that introduced a regression:
$ git bisect start
$ git bisect bad
$ git bisect good 59ee12f
Bisecting: 10 revisions left to test after this (roughly 4 steps)
...
$ git bisect run make testlogic FILES=orderby_nosort'
running make testlogic FILES=orderby_nosort
...
0d1bfc4b92a26f2d6688340b41f9830f4cfc77dc is the first bad commit