bugfix: use cross-platform module filepath to set usedConfigDir (#369)
* bugfix: use filepath to set correct configDir in Windows * test: improve unittest rep folder creation --------- Co-authored-by: wushuzh <wushuzh@outlook.com>
This commit is contained in:
parent
d0eb132b95
commit
ffcd19e748
3
Makefile
3
Makefile
|
|
@ -31,7 +31,8 @@ daemon-codestyle:
|
||||||
gocritic check ./...
|
gocritic check ./...
|
||||||
|
|
||||||
daemon-unittests:
|
daemon-unittests:
|
||||||
mkdir -p reports
|
$(call delete-files,reports)
|
||||||
|
mkdir reports
|
||||||
go test ./... -coverprofile reports/unittests.out
|
go test ./... -coverprofile reports/unittests.out
|
||||||
go tool cover -html=reports/unittests.out -o reports/unittests.html
|
go tool cover -html=reports/unittests.out -o reports/unittests.html
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ test-install:
|
||||||
npm install --no-fund
|
npm install --no-fund
|
||||||
|
|
||||||
test-run:
|
test-run:
|
||||||
./node_modules/.bin/mocha -t 10000
|
npx mocha -t 10000
|
||||||
|
|
||||||
find-flakey-tests:
|
find-flakey-tests:
|
||||||
echo "Running test-run infinately"
|
echo "Running test-run infinately"
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,10 @@ import (
|
||||||
"github.com/prometheus/client_golang/prometheus"
|
"github.com/prometheus/client_golang/prometheus"
|
||||||
"github.com/prometheus/client_golang/prometheus/promauto"
|
"github.com/prometheus/client_golang/prometheus/promauto"
|
||||||
|
|
||||||
log "github.com/sirupsen/logrus"
|
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path/filepath"
|
||||||
|
|
||||||
|
log "github.com/sirupsen/logrus"
|
||||||
|
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
)
|
)
|
||||||
|
|
@ -38,7 +39,7 @@ func Reload(cfg *Config) {
|
||||||
metricConfigReloadedCount.Inc()
|
metricConfigReloadedCount.Inc()
|
||||||
metricConfigActionCount.Set(float64(len(cfg.Actions)))
|
metricConfigActionCount.Set(float64(len(cfg.Actions)))
|
||||||
|
|
||||||
cfg.SetDir(path.Dir(viper.ConfigFileUsed()))
|
cfg.SetDir(filepath.Dir(viper.ConfigFileUsed()))
|
||||||
cfg.Sanitize()
|
cfg.Sanitize()
|
||||||
|
|
||||||
for _, l := range listeners {
|
for _, l := range listeners {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue