diff --git a/Makefile b/Makefile index ad55dc5..1e701ef 100644 --- a/Makefile +++ b/Makefile @@ -31,7 +31,8 @@ daemon-codestyle: gocritic check ./... daemon-unittests: - mkdir -p reports + $(call delete-files,reports) + mkdir reports go test ./... -coverprofile reports/unittests.out go tool cover -html=reports/unittests.out -o reports/unittests.html diff --git a/integration-tests/Makefile b/integration-tests/Makefile index 46132c0..a0a6622 100644 --- a/integration-tests/Makefile +++ b/integration-tests/Makefile @@ -4,7 +4,7 @@ test-install: npm install --no-fund test-run: - ./node_modules/.bin/mocha -t 10000 + npx mocha -t 10000 find-flakey-tests: echo "Running test-run infinately" diff --git a/internal/config/config_reloader.go b/internal/config/config_reloader.go index 5042d12..c33f91a 100644 --- a/internal/config/config_reloader.go +++ b/internal/config/config_reloader.go @@ -4,9 +4,10 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" - log "github.com/sirupsen/logrus" "os" - "path" + "path/filepath" + + log "github.com/sirupsen/logrus" "github.com/spf13/viper" ) @@ -38,7 +39,7 @@ func Reload(cfg *Config) { metricConfigReloadedCount.Inc() metricConfigActionCount.Set(float64(len(cfg.Actions))) - cfg.SetDir(path.Dir(viper.ConfigFileUsed())) + cfg.SetDir(filepath.Dir(viper.ConfigFileUsed())) cfg.Sanitize() for _, l := range listeners {