Beispiel #1
0
func TestPrinting(t *testing.T) {
	hd := master.GetTestDbConnection()
	master.ResetDb(hd)
	master.CreateTables(hd)

	client.Debug("Test Printing...")
	reader := getReader("test")
	workflow, _ := ReadWorkflow(hd, reader)
	str := WorkflowToString(hd, workflow)
	client.Debug(str)
}
Beispiel #2
0
func TestBasicStartWorker(t *testing.T) {
	runtime.GOMAXPROCS(2)

	fmt.Printf("Test: Worker starts up without issues\n")
	hd := master.GetTestDbConnection()
	fmt.Printf("got Db connection")
	master.ResetDb(hd)
	master.CreateTables(hd)

	masterhost := port("localhost", 1324)
	master.StartServer(masterhost, hd)

	workerhost := port("localhost", 2222)
	StartServer(workerhost, masterhost)

	fmt.Printf("  ... Passed\n")
}
Beispiel #3
0
func TestParsing(t *testing.T) {
	hd := master.GetTestDbConnection()
	master.ResetDb(hd)
	master.CreateTables(hd)
	client.Debug("Test Basic...")
	reader := getReader("test")
	if _, err := ReadWorkflow(hd, reader); err != nil {
		log.Fatal(err)
	}
	client.Debug("...passed")
	client.Debug("Test Repeated Job...")
	reader = getReader("test_repeated_job")
	if _, err := ReadWorkflow(hd, reader); err == nil {
		t.Fatalf("should have failed on repeated job")
	}
	client.Debug("...passed")
	client.Debug("Test Undefined Job...")
	reader = getReader("test_undefined_job")
	if _, err := ReadWorkflow(hd, reader); err == nil {
		t.Fatalf("should have failed on undefined job")
	}
	client.Debug("...passed")
}
Beispiel #4
0
/* Reset and initalize the master database tables. Note that this
 * will delete any existing data.
 *
 * Usage:
 *   go run init_dabatase.go
 *
 */
func main() {
	hd := master.GetDbConnection()
	master.ResetDb(hd)
	master.CreateTables(hd)
	client.Debug("Success")
}