integration tests fixes

This commit is contained in:
Radu Ioan Fericean
2015-12-18 15:51:45 +02:00
parent e626d585a5
commit 37c60afeed
2 changed files with 9 additions and 6 deletions

View File

@@ -395,6 +395,9 @@ func TestMatchLoadCsvWithStorRating(t *testing.T) {
for _, key := range keysCsv {
var refVal []byte
for idx, rs := range []*RedisStorage{rsCsv, rsStor, rsApier} {
if key == utils.TASKS_KEY {
continue
}
qVal, err := rs.db.Cmd("GET", key).Bytes()
if err != nil {
t.Fatalf("Run: %d, could not retrieve key %s, error: %s", idx, key, err.Error())

View File

@@ -904,7 +904,7 @@ func (rs *RedisStorage) GetActionPlan(key string, skipCache bool) (ats *ActionPl
}
var values []byte
if values, err = rs.db.Cmd("GET", key).Bytes(); err == nil {
b := bytes.NewBuffer(values)
/*b := bytes.NewBuffer(values)
r, err := zlib.NewReader(b)
if err != nil {
return nil, err
@@ -913,8 +913,8 @@ func (rs *RedisStorage) GetActionPlan(key string, skipCache bool) (ats *ActionPl
if err != nil {
return nil, err
}
r.Close()
err = rs.ms.Unmarshal(out, &ats)
r.Close()*/
err = rs.ms.Unmarshal(values, &ats)
cache2go.Cache(key, ats)
}
return
@@ -932,10 +932,10 @@ func (rs *RedisStorage) SetActionPlan(key string, ats *ActionPlan) (err error) {
return err
}
var b bytes.Buffer
w := zlib.NewWriter(&b)
/*w := zlib.NewWriter(&b)
w.Write(result)
w.Close()
return rs.db.Cmd("SET", utils.ACTION_PLAN_PREFIX+key, b.Bytes()).Err
w.Close()*/
return rs.db.Cmd("SET", utils.ACTION_PLAN_PREFIX+key, result).Err
}
func (rs *RedisStorage) GetAllActionPlans() (ats map[string]*ActionPlan, err error) {