Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…db#62468

62402: roachtest: not fail sqlsmith on known issue r=yuzefovich a=yuzefovich

This commit makes `sqlsmith` roachtest not fail on one known issue (cockroachdb#40929)
in order to avoid unnecessary noise.

Release note: None

62443: lint: don't use -unused.whole-program when PKG is specified r=HonoreDB a=stevendanna

The unused linter's whole program mode will create false-positives
when PKG is specified. As a result, anyone trying to use

    make lint PKG=./pkg/SOMETHING

has to carefully read the failure output to see if it was actually a
success. By not passing that flag when PKG is specified, more cases of
the above command complete without erroneous findings.

Release note: None

62448: Update README.md r=j-low a=kannanlakshmi

Updated quick start section to include a link to CockroachCloud

62468: bazel: set `crdb_test`, `crdb_test_off` build tags appropriately r=rickystewart a=rickystewart

Fixes cockroachdb#61724

Release note: None

Co-authored-by: Yahor Yuzefovich <yahor@cockroachlabs.com>
Co-authored-by: Steven Danna <danna@cockroachlabs.com>
Co-authored-by: Lakshmi Kannan <36172966+kannanlakshmi@users.noreply.github.com>
Co-authored-by: Ricky Stewart <ricky@cockroachlabs.com>
  • Loading branch information
5 people committed Mar 23, 2021
5 parents 49788e4 + e6c5332 + f49997b + 95288c5 + f69bc7f commit 35a64c6
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# TODO(irfansharif): We should fold this into `dev` instead (#56965).

build --ui_event_filters=-DEBUG --define gotags=bazel
test --define gotags=bazel
build --ui_event_filters=-DEBUG --define gotags=bazel,crdb_test_off
test --define gotags=bazel,crdb_test
query --ui_event_filters=-DEBUG

try-import %workspace%/.bazelrc.user
2 changes: 1 addition & 1 deletion BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ load("@bazel_gazelle//:def.bzl", "gazelle")
#
# gazelle:prefix github.com/cockroachdb/cockroach
# gazelle:build_file_name BUILD.bazel
# gazelle:build_tags bazel
# gazelle:build_tags bazel,crdb_test,crdb_test_off

# Enable protobuf generation.
#
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ CockroachDB supports the PostgreSQL wire protocol, so you can use any available

## Deployment

- [Test Deployments](https://www.cockroachlabs.com/docs/stable/deploy-a-test-cluster.html) - Easiest way to test an insecure, multi-node CockroachDB cluster.
- Production Deployments
- [CockroachCloud](https://www.cockroachlabs.com/docs/cockroachcloud/quickstart) - Steps to deploy a [free CockroachCloud cluster](https://cockroachlabs.cloud/signup?referralId=githubquickstart) on public Cloud platforms.
- [Manual](https://www.cockroachlabs.com/docs/stable/manual-deployment.html) - Steps to deploy a CockroachDB cluster manually on multiple machines.
- [Cloud](https://www.cockroachlabs.com/docs/stable/cloud-deployment.html) - Guides for deploying CockroachDB on various cloud platforms.
- [Orchestration](https://www.cockroachlabs.com/docs/stable/orchestration.html) - Guides for running CockroachDB with popular open-source orchestration systems.
Expand Down
19 changes: 14 additions & 5 deletions pkg/cmd/roachtest/sqlsmith.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,20 @@ func registerSQLSmith(r *testRegistry) {
}()
if err != nil {
es := err.Error()
// TODO(yuzefovich): we temporarily ignore internal errors that
// are because of #39433.
if strings.Contains(es, "internal error") && !strings.Contains(es, "internal error: invalid index") {
logStmt(stmt)
t.Fatalf("error: %s\nstmt:\n%s;", err, stmt)
if strings.Contains(es, "internal error") {
// TODO(yuzefovich): we temporarily ignore internal errors
// that are because of #39433 and #40929.
var expectedError bool
for _, exp := range []string{
"internal error: invalid index",
"could not parse \"0E-2019\" as type decimal",
} {
expectedError = expectedError || strings.Contains(es, exp)
}
if !expectedError {
logStmt(stmt)
t.Fatalf("error: %s\nstmt:\n%s;", err, stmt)
}
} else if strings.Contains(es, "communication error") {
// A communication error can be because
// a non-gateway node has crashed.
Expand Down
6 changes: 4 additions & 2 deletions pkg/sql/opt/memo/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
go_library(
name = "memo",
srcs = [
"check_expr_skip.go",
"check_expr.go",
"check_expr_skip.go", # keep
"constraint_builder.go",
"cost.go",
"expr.go",
"expr_format.go",
"expr_name_gen.go",
"extract.go",
"filters_expr_mutate_checker_skip.go",
"filters_expr_mutate_checker.go",
"filters_expr_mutate_checker_skip.go", # keep
"group.go",
"interner.go",
"logical_props_builder.go",
Expand Down
1 change: 1 addition & 0 deletions pkg/sql/opt/props/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ go_library(
"multiplicity.go",
"selectivity.go",
"statistics.go",
"verify.go",
"volatility.go",
],
importpath = "github.com/cockroachdb/cockroach/pkg/sql/opt/props",
Expand Down
10 changes: 7 additions & 3 deletions pkg/testutils/lint/lint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1613,12 +1613,16 @@ func TestLint(t *testing.T) {
t.Run("TestStaticCheck", func(t *testing.T) {
// staticcheck uses 2.4GB of ram (as of 2019-05-10), so don't parallelize it.
skip.UnderShort(t)
var args []string
if pkgSpecified {
args = []string{pkgScope}
} else {
args = []string{"-unused.whole-program", pkgScope}
}
cmd, stderr, filter, err := dirCmd(
crdb.Dir,
"staticcheck",
"-unused.whole-program",
pkgScope,
)
args...)
if err != nil {
t.Fatal(err)
}
Expand Down
1 change: 1 addition & 0 deletions pkg/util/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ go_library(
srcs = [
"constants.go",
"crdb_test_off.go",
"crdb_test_on.go", # keep
"every_n.go",
"fast_int_map.go",
"fast_int_set.go",
Expand Down

0 comments on commit 35a64c6

Please sign in to comment.