Skip to content

Commit

Permalink
Merge pull request #34191 from RaduBerinde/backport2.1-34137
Browse files Browse the repository at this point in the history
release-2.1: logictest: rename --rewrite-results-in-testfiles to --rewrite
  • Loading branch information
RaduBerinde authored Jan 23, 2019
2 parents db8ee13 + 05a68bc commit 38b435b
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions pkg/sql/logictest/logic.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ import (
"time"
"unicode/utf8"

"github.com/pkg/errors"

"github.com/cockroachdb/cockroach/pkg/base"
"github.com/cockroachdb/cockroach/pkg/roachpb"
"github.com/cockroachdb/cockroach/pkg/security"
Expand All @@ -63,6 +61,7 @@ import (
"github.com/cockroachdb/cockroach/pkg/util/syncutil"
"github.com/cockroachdb/cockroach/pkg/util/timeutil"
"github.com/lib/pq"
"github.com/pkg/errors"
)

// This file is home to TestLogic, a general-purpose engine for
Expand Down Expand Up @@ -349,7 +348,7 @@ var (
"or -flex-types.",
)
rewriteResultsInTestfiles = flag.Bool(
"rewrite-results-in-testfiles", false,
"rewrite", false,
"ignore the expected results and rewrite the test files with the actual results from this "+
"run. Used to update tests when a change affects many cases; please verify the testfile "+
"diffs carefully!",
Expand Down Expand Up @@ -1445,8 +1444,8 @@ func (t *logicTest) processSubtest(
// even if there is whitespace in the value.
query.expectedResults = append(query.expectedResults, strings.Join(results, " "))
} else {
// Don't error if --rewrite-results-in-testfiles is specified,
// since the expected results are ignored in that case.
// Don't error if --rewrite is specified, since the expected
// results are ignored in that case.
if !*rewriteResultsInTestfiles && len(results) != len(query.colTypes) {
return errors.Errorf("expected results are invalid: unexpected column count")
}
Expand Down

0 comments on commit 38b435b

Please sign in to comment.