From 33ddeeb601aafc16d7d69d815b188e3458f9ab73 Mon Sep 17 00:00:00 2001 From: Alfonso Subiotto Marques Date: Tue, 16 Jun 2020 12:30:47 +0200 Subject: [PATCH] logictest: add -print-blocklist-issues flag Previously all issues associated with a blocklist were printed out, even when running a single test. This commit turns that printing off by default, which can be enabled by specifying the -print-blocklist-issues flag. Release note: None (testing change) --- pkg/sql/logictest/logic.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/pkg/sql/logictest/logic.go b/pkg/sql/logictest/logic.go index 0dff48d64fd7..13d7707aa0d6 100644 --- a/pkg/sql/logictest/logic.go +++ b/pkg/sql/logictest/logic.go @@ -121,6 +121,14 @@ import ( // // # LogicTest: !3node-tenant // +// An issue can optionally be specified as the reason for blocking a given +// configuration: +// +// # LogicTest: !3node-tenant() +// +// A link to the issue will be printed out if the -print-blocklist-issues flag +// is specified. +// // The Test-Script language is extended here for use with CockroachDB. The // supported directives are: // @@ -399,6 +407,10 @@ var ( "optimizer-cost-perturbation", 0, "randomly perturb the estimated cost of each expression in the query tree by at most the "+ "given fraction for the purpose of creating alternate query plans in the optimizer.") + printBlocklistIssues = flag.Bool( + "print-blocklist-issues", false, + "for any test files that contain a blocklist directive, print a link to the associated issue", + ) ) type testClusterConfig struct { @@ -1448,7 +1460,7 @@ func processConfigs(t *testing.T, path string, configNames []string) []logicTest } blockedConfig, issueNo := getBlocklistIssueNo(configName[1:]) - if issueNo != 0 { + if *printBlocklistIssues && issueNo != 0 { t.Logf("will skip %s config in test %s due to issue: %s", blockedConfig, path, unimplemented.MakeURL(issueNo)) } blocklist[blockedConfig] = issueNo