functional tests, minor refactoring and lint/cleanup (#1570)

* cmd/crowdsec: removed log.Fatal()s, added tests and print error for unrecognized argument
* updated golangci-lint to v1.46
* lint/deadcode: fix existing issues
* tests: cscli config backup/restore
* tests: cscli completion powershell/fish
* err check: pflags MarkHidden()
* empty .dockerignore (and explain the reason)
* tests, errors.Wrap
* test for CS_LAPI_SECRET and minor refactoring
* minor style changes
* log cleanup
This commit is contained in:
mmetc 2022-06-06 15:24:48 +02:00 committed by GitHub
parent df7c51f34e
commit 799cc82bb5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
48 changed files with 388 additions and 278 deletions

View file

@ -12,22 +12,22 @@ import (
func TestLoadHub(t *testing.T) {
hubFullPath, err := filepath.Abs("./hub")
if err != nil {
t.Fatalf(err.Error())
t.Fatal(err)
}
dataFullPath, err := filepath.Abs("./data")
if err != nil {
t.Fatalf(err.Error())
t.Fatal(err)
}
configDirFullPath, err := filepath.Abs("./tests")
if err != nil {
t.Fatalf(err.Error())
t.Fatal(err)
}
hubIndexFileFullPath, err := filepath.Abs("./hub/.index.json")
if err != nil {
t.Fatalf(err.Error())
t.Fatal(err)
}
tests := []struct {