Skip to content

Commit

Permalink
fix: Begin with linter warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
MikMuellerDev committed Oct 15, 2024
1 parent 3de0088 commit b45fed5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
3 changes: 1 addition & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ linters:
- durationcheck
- errchkjson
- errname
- execinquery
- exportloopref
#- forcetypeassert
- funlen
Expand All @@ -28,7 +27,7 @@ linters:
- godot
- godox
- gofmt
- gomnd
- mnd
- gosec
- gosmopolitan
- importas
Expand Down
11 changes: 7 additions & 4 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ import (
"github.com/stretchr/testify/assert"

"github.com/smarthome-go/smarthome/core"
"github.com/smarthome-go/smarthome/core/automation"
"github.com/smarthome-go/smarthome/core/database"
"github.com/smarthome-go/smarthome/core/event"
"github.com/smarthome-go/smarthome/core/homescript"
"github.com/smarthome-go/smarthome/core/scheduler"
"github.com/smarthome-go/smarthome/core/utils"
"github.com/smarthome-go/smarthome/server/api"
"github.com/smarthome-go/smarthome/server/middleware"
Expand All @@ -23,8 +25,7 @@ import (

func TestServer(t *testing.T) {
// Create logger
log, err := utils.NewLogger(logrus.FatalLevel)
assert.NoError(t, err)
log := utils.NewLogger(logrus.FatalLevel)

// Initialize module loggers
core.InitLoggers(log)
Expand Down Expand Up @@ -70,11 +71,13 @@ func TestServer(t *testing.T) {

assert.NoError(t, database.SetAutomationSystemActivation(true))

hms := homescript.InitManager()

// Initializes the automation scheduler
assert.NoError(t, homescript.InitAutomations(serverConfig))
assert.NoError(t, automation.InitManager(hms, serverConfig))

// Initializes the normal scheduler
assert.NoError(t, homescript.InitScheduler())
assert.NoError(t, scheduler.InitManager(hms))

r := routes.NewRouter()
middleware.InitWithRandomKey()
Expand Down

0 comments on commit b45fed5

Please sign in to comment.