add integration test guard;

datadog integration test works

influx package tests

update unifi version

golanglint-ci and address *all* issues.

all tests pass

bump unifi version
This commit is contained in:
Cody Lee
2023-07-20 10:12:44 -05:00
parent 8cf461b0f5
commit ffb8579369
57 changed files with 2241 additions and 178 deletions

View File

@@ -62,19 +62,25 @@ func (u *UnifiPoller) DebugIO() error {
defer outputSync.RUnlock()
allOK := true
var allErr error
u.Logf("Checking inputs...")
totalInputs := len(inputs)
for i, input := range inputs {
u.Logf("\t(%d/%d) Checking input %s...", i+1, totalInputs, input.Name)
ok, err := input.DebugInput()
if !ok {
u.LogErrorf("\t\t %s Failed: %v", input.Name, err)
allOK = false
} else {
u.Logf("\t\t %s is OK", input.Name)
}
if err != nil {
if allErr == nil {
allErr = err
@@ -85,16 +91,21 @@ func (u *UnifiPoller) DebugIO() error {
}
u.Logf("Checking outputs...")
totalOutputs := len(outputs)
for i, output := range outputs {
u.Logf("\t(%d/%d) Checking output %s...", i+1, totalOutputs, output.Name)
ok, err := output.DebugOutput()
if !ok {
u.LogErrorf("\t\t %s Failed: %v", output.Name, err)
allOK = false
} else {
u.Logf("\t\t %s is OK", output.Name)
}
if err != nil {
if allErr == nil {
allErr = err
@@ -103,8 +114,10 @@ func (u *UnifiPoller) DebugIO() error {
}
}
}
if !allOK {
u.LogErrorf("No all checks passed, please fix the logged issues.")
}
return allErr
}