diff options
-rw-r--r-- | main.go | 10 | ||||
-rw-r--r-- | submitqueue/test_runner.go | 30 |
2 files changed, 38 insertions, 2 deletions
diff --git a/main.go b/main.go index f939c7e370c4..9f3277e9a90e 100644 --- a/main.go +++ b/main.go @@ -107,13 +107,19 @@ func main() { handler := frontend.MakeFrontend(rotatingLogHandler, gerrit, runner) // fetch only on first run - runner.Trigger(fetchOnly) + err = runner.Trigger(fetchOnly) + if err != nil { + log.Error(err.Error()) + } // ticker go func() { for { time.Sleep(time.Duration(triggerInterval) * time.Second) - runner.Trigger(fetchOnly) + err = runner.Trigger(fetchOnly) + if err != nil { + log.Error(err.Error()) + } } }() diff --git a/submitqueue/test_runner.go b/submitqueue/test_runner.go new file mode 100644 index 000000000000..e5c33cb2e56a --- /dev/null +++ b/submitqueue/test_runner.go @@ -0,0 +1,30 @@ +package submitqueue + +// import ( +// "testing" + +// "github.com/apex/log" +// "github.com/apex/log/handlers/memory" +// "github.com/tweag/gerrit-queue/gerrit" +// ) + +// type MockClient struct { +// gerrit.Client +// } + +// func (c *MockClient) Refresh() error { +// return nil +// } + +// func TestNewRunner(t *testing.T) { +// logger := &log.Logger{ +// Handler: memory.New(), +// } + +// //TODO +// gerrit := &MockClient { +// client: nil, +// } +// submitQueueTag := "submitme" +// runner := NewRunner(logger, gerrit, submitQueueTag) +// } |