Ejemplo n.º 1
0
func TestMain(m *testing.M) {
	// Experimental features
	xNewApply := flag.Bool("Xnew-apply", false, "Experiment: new apply graph")

	// Normal features
	shadow := flag.Bool("shadow", true, "Enable shadow graph")

	flag.Parse()

	// Setup experimental features
	X_newApply = *xNewApply

	if testing.Verbose() {
		// if we're verbose, use the logging requested by TF_LOG
		logging.SetOutput()
	} else {
		// otherwise silence all logs
		log.SetOutput(ioutil.Discard)
	}

	// Make sure shadow operations fail our real tests
	contextFailOnShadowError = true

	// Always DeepCopy the Diff on every Plan during a test
	contextTestDeepCopyOnPlan = true

	// Shadow the new graphs
	contextTestShadow = *shadow

	os.Exit(m.Run())
}
Ejemplo n.º 2
0
func TestMain(m *testing.M) {
	flag.Parse()
	if testing.Verbose() {
		// if we're verbose, use the logging requested by TF_LOG
		logging.SetOutput()
	} else {
		// otherwise silence all logs
		log.SetOutput(ioutil.Discard)
	}

	os.Exit(m.Run())
}
Ejemplo n.º 3
0
func TestMain(m *testing.M) {
	experiment.Flag(flag.CommandLine)
	flag.Parse()

	if testing.Verbose() {
		// if we're verbose, use the logging requested by TF_LOG
		logging.SetOutput()
	} else {
		// otherwise silence all logs
		log.SetOutput(ioutil.Discard)
	}

	// Make sure shadow operations fail our real tests
	contextFailOnShadowError = true

	// Always DeepCopy the Diff on every Plan during a test
	contextTestDeepCopyOnPlan = true

	os.Exit(m.Run())
}