Building and running tests

vivekmenezes edited this page Feb 16, 2018 · 9 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'

Running tests, showing which tests are run and test failures but not the CockroachDB log details:

make test PKG=./sql TESTFLAGS='-v -logtostderr NONE'

Finding a test that fails:

make test PKG=./sql TESTFLAGS='-v -logtostderr NONE' | grep FAIL

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
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.