Example #1
0
func (s *ManagerTestSuite) SetUpTest(t *C) {
	s.nullmysql.Reset()
	s.clock = mock.NewClock()
	if err := test.ClearDir(pct.Basedir.Dir("config"), "*"); err != nil {
		t.Fatal(err)
	}
}
Example #2
0
func (s *ManagerTestSuite) SetUpTest(t *C) {
	err := s.realmysql.Set(s.reset)
	if err != nil {
		t.Fatal(err)
	}
	s.nullmysql.Reset()
	s.clock = mock.NewClock()

	s.iterFactory.Iters = []qan.IntervalIter{s.iter}
	s.iterFactory.TickChans = make(map[qan.IntervalIter]chan time.Time)
	s.iterFactory.Reset()
}
Example #3
0
func (s *ManagerTestSuite) SetUpTest(t *C) {
	s.clock = mock.NewClock()
	glob := filepath.Join(pct.Basedir.Dir("config"), "*")
	files, err := filepath.Glob(glob)
	if err != nil {
		t.Fatal(err)
	}
	for _, file := range files {
		if err := os.Remove(file); err != nil {
			t.Fatal(err)
		}
	}
}
Example #4
0
func (s *AnalyzerTestSuite) SetUpTest(t *C) {
	s.nullmysql.Reset()
	s.iter.Reset()
	s.spool.Reset()
	s.clock = mock.NewClock()
	if err := test.ClearDir(s.configDir, "*"); err != nil {
		t.Fatal(err)
	}
	s.worker = mock.NewQanWorker()
	// Config needs to be recreated on every test since it can be modified by the test analyzers
	s.config = qan.Config{
		ServiceInstance: s.mysqlInstance,
		CollectFrom:     "slowlog",
		Interval:        60,
		WorkerRunTime:   60,
		MaxSlowLogSize:  MAX_SLOW_LOG_SIZE,
		Start: []mysql.Query{
			mysql.Query{Set: "-- start"},
		},
		Stop: []mysql.Query{
			mysql.Query{Set: "-- stop"},
		},
	}
}