test(pkg/storage): add test for compression and rounding

This commit is contained in:
2019-10-11 12:36:00 +02:00
parent 86f598bc7d
commit 25dd99cd3d
68 changed files with 7713 additions and 1481 deletions

View File

@ -9,12 +9,12 @@ import (
"github.com/Masterminds/semver"
"github.com/go-flucky/flucky/pkg/config"
"github.com/volker-raschek/go-logger/pkg/logger"
"github.com/go-flucky/flucky/pkg/rgbled"
"github.com/go-flucky/flucky/pkg/sensor"
"github.com/go-flucky/flucky/pkg/storage/db"
"github.com/go-flucky/flucky/pkg/storage/logfile"
"github.com/go-flucky/flucky/pkg/types"
"github.com/volker-raschek/go-logger/pkg/logger"
)
var (
@ -102,7 +102,7 @@ func Start(cnf *config.Configuration, cleanCacheInterval time.Duration, compress
flogger.Error("Can not turn on blue info light: %v", err)
}
if err := logfile.Append(measuredValuesLogfile, compression, round, measuredValuesCache); err != nil {
if err := logfile.Append(measuredValuesLogfile, measuredValuesCache); err != nil {
err2 := rgbled.Error(rgbLEDs)
if err2 != nil {
flogger.Error("Can not turn on red info light: %v", err2)
@ -136,7 +136,7 @@ func Start(cnf *config.Configuration, cleanCacheInterval time.Duration, compress
}
flogger.Warn("Save remaining data from the cache")
err = logfile.Append(measuredValuesLogfile, compression, round, measuredValuesCache)
err = logfile.Append(measuredValuesLogfile, measuredValuesCache)
if err != nil {
flogger.Fatal("%v", err)
}