Example #1
0
func setupAction(testCases []*test.TestCase, ctx *cli.Context) {
	for _, testCase := range testCases {
		err := testCase.Transition(test.SETUP)
		if err != nil {
			commands.Error(err)
		}
	}
}
Example #2
0
func provisionAction(testCases []*test.TestCase, ctx *cli.Context) {
	for _, testCase := range testCases {
		err := testCase.Transition(test.PROVISIONED)
		if err != nil {
			commands.Error(err)
		}
	}
}
Example #3
0
func destroyAction(testCases []*test.TestCase, ctx *cli.Context) {
	for _, testCase := range testCases {
		err := testCase.Transition(test.DESTROYED)
		if err != nil {
			commands.Error(err)
		}
	}
}
Example #4
0
func verifyAction(testCases []*test.TestCase, ctx *cli.Context) {
	for _, testCase := range testCases {
		err := testCase.Transition(test.VERIFIED)
		if err != nil {
			commands.Error(err)
		}
	}
}
Example #5
0
func testAction(testCases []*test.TestCase, ctx *cli.Context) {
	failed := false
	for _, testCase := range testCases {
		err := testCase.Transition(test.VERIFIED)
		if err != nil {
			commands.Error(err)
		}
		if testCase.State == test.FAILED {
			failed = true
		}
		if !ctx.Bool("dont-destroy") {
			err = testCase.Transition(test.DESTROYED)
			if err != nil {
				commands.Error(err)
			}
		}
	}
	if failed {
		os.Exit(1)
	}
}