Exemplo n.º 1
0
func (s *BaseSuite) SetUpTest(c *C) {
	s.job = &TestJob{}
	sh := core.NewScheduler(&TestLogger{})
	e := core.NewExecution()

	s.ctx = core.NewContext(sh, s.job, e)
}
Exemplo n.º 2
0
func (c *Config) build() (*core.Scheduler, error) {
	defaults.SetDefaults(c)

	d, err := c.buildDockerClient()
	if err != nil {
		return nil, err
	}

	sh := core.NewScheduler(c.buildLogger())
	c.buildSchedulerMiddlewares(sh)

	for name, j := range c.Jobs {
		defaults.SetDefaults(j)

		j.Client = d
		j.Name = name
		j.buildMiddlewares()
		sh.AddJob(j)
	}

	return sh, nil
}