Skip to content

Commit

Permalink
Add test for metrics init
Browse files Browse the repository at this point in the history
  • Loading branch information
berejant committed Oct 15, 2023
1 parent 86768ab commit e3c231a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
"bytes"
"errors"
victoriaMetricsInit "github.com/kneu-messenger-pigeon/victoria-metrics-init"
"github.com/stretchr/testify/assert"
"net/http"
"os"
Expand Down Expand Up @@ -30,6 +31,9 @@ func TestRunApp(t *testing.T) {

assert.NoError(t, err, "Expected for TooManyError, got %s", err)
assert.Equal(t, expectedConfig.listenAddress, actualListen)

assert.Equal(t, "authorizer", victoriaMetricsInit.LastInstance)

})

t.Run("Run with wrong env file", func(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ module authorizer
go 1.19

require (
github.com/VictoriaMetrics/metrics v1.24.0
github.com/berejant/go-kneu v0.1.7
github.com/gin-gonic/gin v1.8.2
github.com/golang-jwt/jwt/v5 v5.0.0-rc.1
github.com/joho/godotenv v1.4.0
github.com/kneu-messenger-pigeon/events v0.1.41
github.com/kneu-messenger-pigeon/victoria-metrics-init v0.1.1
github.com/kneu-messenger-pigeon/victoria-metrics-init v0.1.2
github.com/segmentio/kafka-go v0.4.38
github.com/stretchr/testify v1.8.4
)

require (
github.com/VictoriaMetrics/metrics v1.24.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/go-playground/locales v0.14.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ github.com/klauspost/compress v1.15.9 h1:wKRjX6JRtDdrE9qwa4b/Cip7ACOshUI4smpCQan
github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU=
github.com/kneu-messenger-pigeon/events v0.1.41 h1:Yzzp7oyVArzKzzI93HmLX+k3lUn8E3dKUk9uNF3le+8=
github.com/kneu-messenger-pigeon/events v0.1.41/go.mod h1:Q6X8B9gKZpKbby9gisLumvGT1xCWBM7bAFnviYi6MBQ=
github.com/kneu-messenger-pigeon/victoria-metrics-init v0.1.1 h1:ndU8DvMAnaMZIZ+hLKaQCTNGcRBBQpvRZ/7CtE/UXu0=
github.com/kneu-messenger-pigeon/victoria-metrics-init v0.1.1/go.mod h1:HxDZwQUrMLgZNdLFT1llblZ7Zj6EBpBk7+9tcU4NZCk=
github.com/kneu-messenger-pigeon/victoria-metrics-init v0.1.2 h1:jtKQpIefoZBJzgniS4+wM/HU+IgAPkhdOZa4B52RZA0=
github.com/kneu-messenger-pigeon/victoria-metrics-init v0.1.2/go.mod h1:HxDZwQUrMLgZNdLFT1llblZ7Zj6EBpBk7+9tcU4NZCk=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
Expand Down

0 comments on commit e3c231a

Please sign in to comment.