mirror of https://github.com/databricks/cli.git
acc: Do not show all replacements on every failure (#2331)
## Changes - Only print replacements if VERBOSE_TEST flag is set. - This is set on CI but not when you do "go test" or "make test". Note, env var is used, so that it can be set in Makefile. ## Tests Manually.
This commit is contained in:
parent
e81ec4ee23
commit
f2096eddcc
4
Makefile
4
Makefile
|
@ -28,7 +28,7 @@ test:
|
||||||
|
|
||||||
cover:
|
cover:
|
||||||
rm -fr ./acceptance/build/cover/
|
rm -fr ./acceptance/build/cover/
|
||||||
CLI_GOCOVERDIR=build/cover ${GOTESTSUM_CMD} -- -coverprofile=coverage.txt ${PACKAGES}
|
VERBOSE_TEST=1 CLI_GOCOVERDIR=build/cover ${GOTESTSUM_CMD} -- -coverprofile=coverage.txt ${PACKAGES}
|
||||||
rm -fr ./acceptance/build/cover-merged/
|
rm -fr ./acceptance/build/cover-merged/
|
||||||
mkdir -p acceptance/build/cover-merged/
|
mkdir -p acceptance/build/cover-merged/
|
||||||
go tool covdata merge -i $$(printf '%s,' acceptance/build/cover/* | sed 's/,$$//') -o acceptance/build/cover-merged/
|
go tool covdata merge -i $$(printf '%s,' acceptance/build/cover/* | sed 's/,$$//') -o acceptance/build/cover-merged/
|
||||||
|
@ -61,6 +61,6 @@ integration: vendor
|
||||||
$(INTEGRATION)
|
$(INTEGRATION)
|
||||||
|
|
||||||
integration-short: vendor
|
integration-short: vendor
|
||||||
$(INTEGRATION) -short
|
VERBOSE_TEST=1 $(INTEGRATION) -short
|
||||||
|
|
||||||
.PHONY: lint tidy lintcheck fmt test cover showcover build snapshot vendor schema integration integration-short acc-cover acc-showcover docs
|
.PHONY: lint tidy lintcheck fmt test cover showcover build snapshot vendor schema integration integration-short acc-cover acc-showcover docs
|
||||||
|
|
|
@ -30,8 +30,9 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
KeepTmp bool
|
KeepTmp bool
|
||||||
NoRepl bool
|
NoRepl bool
|
||||||
|
VerboseTest bool = os.Getenv("VERBOSE_TEST") != ""
|
||||||
)
|
)
|
||||||
|
|
||||||
// In order to debug CLI running under acceptance test, set this to full subtest name, e.g. "bundle/variables/empty"
|
// In order to debug CLI running under acceptance test, set this to full subtest name, e.g. "bundle/variables/empty"
|
||||||
|
@ -412,7 +413,7 @@ func doComparison(t *testing.T, repls testdiff.ReplacementsContext, dirRef, dirN
|
||||||
testutil.WriteFile(t, pathRef, valueNew)
|
testutil.WriteFile(t, pathRef, valueNew)
|
||||||
}
|
}
|
||||||
|
|
||||||
if !equal && printedRepls != nil && !*printedRepls {
|
if VerboseTest && !equal && printedRepls != nil && !*printedRepls {
|
||||||
*printedRepls = true
|
*printedRepls = true
|
||||||
var items []string
|
var items []string
|
||||||
for _, item := range repls.Repls {
|
for _, item := range repls.Repls {
|
||||||
|
|
Loading…
Reference in New Issue