Skip to content

Commit

Permalink
Merge pull request #20835 from knz/20171218-row-counts
Browse files Browse the repository at this point in the history
cli: avoid special line at the end of CSV/TSV output
  • Loading branch information
knz committed Feb 7, 2018
2 parents 0c577f2 + 13d9e88 commit 673fb4b
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 100 deletions.
1 change: 0 additions & 1 deletion build/verify-archive.sh
Expand Up @@ -24,6 +24,5 @@ EOF
diff -u - <(cockroach sql --insecure -e 'SELECT * FROM bank.accounts') <<EOF
id balance
1 1000.50
# 1 row
EOF
cockroach quit --insecure
10 changes: 1 addition & 9 deletions pkg/acceptance/decommission_test.go
Expand Up @@ -145,6 +145,7 @@ func testDecommissionInner(
InitialBackoff: time.Second,
MaxBackoff: 5 * time.Second,
Multiplier: 1,
MaxRetries: 20,
}
for r := retry.Start(retryOpts); r.Next(); {
o, err := decommission(ctx, c, 1, idMap[0], "decommission", "--wait", "none", "--format", "csv")
Expand All @@ -155,7 +156,6 @@ func testDecommissionInner(
exp := [][]string{
decommissionHeader,
{strconv.Itoa(int(idMap[0])), "true", "0", "true", "true"},
{"# 1 row"},
decommissionFooterLive,
}
log.Infof(ctx, o)
Expand All @@ -179,7 +179,6 @@ func testDecommissionInner(
{"2"},
{"3"},
{"4"},
{"# 4 rows"},
}
if err := matchCSV(o, exp); err != nil {
t.Fatal(err)
Expand All @@ -197,7 +196,6 @@ func testDecommissionInner(
{`2`, `.*`, `.*`, `.*`, `.*`, `.*`},
{`3`, `.*`, `.*`, `.*`, `.*`, `.*`},
{`4`, `.*`, `.*`, `.*`, `.*`, `.*`},
{"# 4 rows"},
}
if err := matchCSV(o, exp); err != nil {
t.Fatal(err)
Expand Down Expand Up @@ -230,7 +228,6 @@ func testDecommissionInner(
exp := [][]string{
decommissionHeader,
{strconv.Itoa(int(target)), "true", "0", "true", "true"},
{"# 1 row"},
decommissionFooter,
}
if err := matchCSV(o, exp); err != nil {
Expand Down Expand Up @@ -288,7 +285,6 @@ func testDecommissionInner(
exp := [][]string{
decommissionHeader,
{strconv.Itoa(int(target)), "true", "0", "true", "true"},
{"# 1 row"},
decommissionFooter,
}
if err := matchCSV(o, exp); err != nil {
Expand Down Expand Up @@ -336,7 +332,6 @@ func testDecommissionInner(
exp := [][]string{
decommissionHeader,
{strconv.Itoa(int(target)), "true", "0", "true", "true"},
{"# 1 row"},
decommissionFooter,
}
if err := matchCSV(o, exp); err != nil {
Expand Down Expand Up @@ -378,7 +373,6 @@ func testDecommissionInner(
exp := [][]string{
decommissionHeader,
{strconv.Itoa(int(target)), `true|false`, `\d+`, `true`, `true|false`},
{"# 1 row"},
decommissionFooterLive,
}
if err := matchCSV(o, exp); err != nil {
Expand All @@ -401,7 +395,6 @@ func testDecommissionInner(
{"2"},
{"3"},
{"4"},
{"# 3 rows"},
}

if err := matchCSV(o, exp); err != nil {
Expand All @@ -423,7 +416,6 @@ func testDecommissionInner(
{`2`, `.*`, `.*`, `.*`, `.*`, `.*`},
{`3`, `.*`, `.*`, `.*`, `.*`, `.*`},
{`4`, `.*`, `.*`, `.*`, `.*`, `.*`},
{"# 3 rows"},
}
if err := matchCSV(o, exp); err != nil {
time.Sleep(time.Second)
Expand Down

0 comments on commit 673fb4b

Please sign in to comment.