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