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) }
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") }
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") }