Exemple #1
0
func test(c *cli.Context) {
	populateInventory()

	opts := scrub_input(TestOpts{
		Threads: c.Int("parallel"),
		Retries: c.Int("retries"),
	})

	// Build the images and run the tests defined in the inventory file
	errs := runTests(inventory, opts)

	// Determine if the tests passed or failed
	if errs > 0 {
		// Not all tests passed, this makes docker-test a sad panda
		fmt.Printf("# Conclusion\n\n%v tests failed.\n\n", errs)
		os.Exit(1)
	}
	// All tests and builds completed succesfully!
	fmt.Printf("# Conclusion\n\nall tests passed.\n\n")

	// Tag images with aliases
	errs = runAlias(inventory)
	if errs > 0 {
		fmt.Printf("# Conclusion\n\n%v aliases failed.\n\n", errs)
		os.Exit(1)
	}

	fmt.Printf("# Conclusion\n\nall aliases succeeded.\n\n", errs)
	os.Exit(0)

}
Exemple #2
0
func push(c *cli.Context) {
	populateInventory()

	opts := scrub_input(TestOpts{
		Threads: c.Int("parallel"),
		Retries: c.Int("retries"),
	})

	errs := runPushes(inventory, opts)

	// Determine if the tests passed or failed
	if errs > 0 {
		// Not all tests passed, this makes docker-test a sad panda
		fmt.Printf("# Conclusion\n\n%v pushes failed.\n\n", errs)
		os.Exit(1)
	} else {
		// All tests and builds completed succesfully!
		fmt.Printf("# Conclusion\n\nall pushes succeeded.\n\n")
		os.Exit(0)
	}

}