mirror of https://github.com/databricks/cli.git
acc: add -norepl flag that disables replacements (for debugging) (#2269)
This commit is contained in:
parent
a03ea73011
commit
f1efbd7d9f
|
@ -25,7 +25,10 @@ import (
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
||||||
var KeepTmp bool
|
var (
|
||||||
|
KeepTmp bool
|
||||||
|
NoRepl bool
|
||||||
|
)
|
||||||
|
|
||||||
// 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"
|
||||||
// Then install your breakpoints and click "debug test" near TestAccept in VSCODE.
|
// Then install your breakpoints and click "debug test" near TestAccept in VSCODE.
|
||||||
|
@ -40,6 +43,7 @@ var InprocessMode bool
|
||||||
func init() {
|
func init() {
|
||||||
flag.BoolVar(&InprocessMode, "inprocess", SingleTest != "", "Run CLI in the same process as test (for debugging)")
|
flag.BoolVar(&InprocessMode, "inprocess", SingleTest != "", "Run CLI in the same process as test (for debugging)")
|
||||||
flag.BoolVar(&KeepTmp, "keeptmp", false, "Do not delete TMP directory after run")
|
flag.BoolVar(&KeepTmp, "keeptmp", false, "Do not delete TMP directory after run")
|
||||||
|
flag.BoolVar(&NoRepl, "norepl", false, "Do not apply any replacements (for debugging)")
|
||||||
}
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -272,7 +276,9 @@ func doComparison(t *testing.T, repls testdiff.ReplacementsContext, dirRef, dirN
|
||||||
|
|
||||||
// Apply replacements to the new value only.
|
// Apply replacements to the new value only.
|
||||||
// The reference value is stored after applying replacements.
|
// The reference value is stored after applying replacements.
|
||||||
|
if !NoRepl {
|
||||||
valueNew = repls.Replace(valueNew)
|
valueNew = repls.Replace(valueNew)
|
||||||
|
}
|
||||||
|
|
||||||
// The test did not produce an expected output file.
|
// The test did not produce an expected output file.
|
||||||
if okRef && !okNew {
|
if okRef && !okNew {
|
||||||
|
|
Loading…
Reference in New Issue