diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index 929239e..8f1fc72 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -8,7 +8,7 @@ version: "3" services: # Update this to the name of the service you want to work with in your docker-compose.yml file go: - image: golang:1.22 + image: golang:1.23 # If you want add a non-root user to your Dockerfile, you can use the "remoteUser" # property in devcontainer.json to cause VS Code its sub-processes (terminals, tasks, # debugging) to execute as the user. Uncomment the next line if you want the entire @@ -44,7 +44,7 @@ services: depends_on: - passenger-app passenger-app: - image: ghcr.io/rakutentech/passenger-go-exporter/passenger-app:6.0.20 + image: ghcr.io/rakutentech/passenger-go-exporter/passenger-app:6.0.23 platform: linux/x86_64 ports: - 3000:3000 diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 46d5159..4f17438 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -13,9 +13,9 @@ jobs: strategy: matrix: passenger-version: - - 6.0.18 - - 6.0.19 - - 6.0.20 + - 6.0.21 + - 6.0.22 + - 6.0.23 steps: - uses: actions/checkout@v4 - uses: helm/kind-action@v1 diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index d300576..e59ac6f 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -15,7 +15,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: '1.22' + go-version: '1.23' cache: false - uses: actions/cache@v4 with: @@ -29,7 +29,7 @@ jobs: if: steps.cache.outputs.cache-hit != 'true' run: go mod download - name: build - run: go build . + run: go build . - name: test run: go test -json ./... > test.json - name: annotate tests @@ -41,12 +41,12 @@ jobs: name: Lint strategy: matrix: - go-version: [1.22] + go-version: [1.23] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: '1.22' + go-version: '1.23' cache: false - - uses: golangci/golangci-lint-action@v3 + - uses: golangci/golangci-lint-action@v6 diff --git a/.golangci.yaml b/.golangci.yaml index 9826757..ce83874 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -17,14 +17,14 @@ run: # from this option's value (see skip-dirs-use-default). # "/" will be replaced by current OS file path separator to properly work # on Windows. - skip-dirs: + issues.exclude-dirs: - src/external_libs - autogenerated_by_my_lib # output configuration options output: # colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number" - format: line-number + formats: line-number # print lines of code with issue, default is true print-issued-lines: true @@ -43,7 +43,7 @@ output: # all available settings of specific linters -linters-settings: +linters: errcheck: # report about not checking of errors in type assertions: `a := b.(MyStruct)`; # default is false: such cases aren't reported by default. @@ -78,10 +78,8 @@ linters-settings: min-confidence: 0.8 govet: # report about shadowed variables - check-shadowing: true - maligned: - # print struct with more effective memory layout or not, false by default - suggest-new: true + shadow: true + fieldalignment: true misspell: # Correct spellings using locale preferences for US or UK. # Default is to use a neutral variety of English. @@ -96,8 +94,6 @@ linters-settings: enable: - asciicheck - misspell - - maligned - - golint - gofmt - gocyclo - gocritic diff --git a/doc.go b/doc.go index 9fe9bec..facedb8 100644 --- a/doc.go +++ b/doc.go @@ -2,7 +2,7 @@ // Licensed under the MIT License. // License that can be found in the LICENSE file. -// Contained Promethues Component for monitoring Passenger application. +// Contained Prometheus Component for monitoring Passenger application. // // If you want to know the metrics or so on, ,Please refer to the README. package main diff --git a/go.mod b/go.mod index c09f4f4..417dad3 100644 --- a/go.mod +++ b/go.mod @@ -1,13 +1,13 @@ module github.com/rakutentech/passenger-go-exporter -go 1.22 +go 1.23.1 require ( - github.com/prometheus/client_golang v1.18.0 - github.com/prometheus/common v0.46.0 - github.com/stretchr/testify v1.8.0 - golang.org/x/net v0.21.0 - golang.org/x/sys v0.17.0 // indirect + github.com/prometheus/client_golang v1.20.4 + github.com/prometheus/common v0.59.1 + github.com/stretchr/testify v1.9.0 + golang.org/x/net v0.29.0 + golang.org/x/sys v0.25.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) @@ -15,13 +15,15 @@ require github.com/go-kit/log v0.2.1 require ( github.com/beorn7/perks v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/go-logfmt/logfmt v0.6.0 // indirect + github.com/klauspost/compress v1.17.9 // indirect github.com/kr/text v0.2.0 // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_model v0.5.0 // indirect - github.com/prometheus/procfs v0.12.0 // indirect - golang.org/x/text v0.14.0 // indirect - google.golang.org/protobuf v1.33.0 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/procfs v0.15.1 // indirect + golang.org/x/text v0.18.0 // indirect + google.golang.org/protobuf v1.34.2 // indirect ) diff --git a/go.sum b/go.sum index 2c4f5fe..df61de9 100644 --- a/go.sum +++ b/go.sum @@ -1,51 +1,52 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= -github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= +github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= -github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= -github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= -github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= -github.com/prometheus/common v0.46.0 h1:doXzt5ybi1HBKpsZOL0sSkaNHJJqkyfEWZGGqqScV0Y= -github.com/prometheus/common v0.46.0/go.mod h1:Tp0qkxpb9Jsg54QMe+EAmqXkSV7Evdy1BTn+g2pa/hQ= -github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= -github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= +github.com/prometheus/client_golang v1.20.4 h1:Tgh3Yr67PaOv/uTqloMsCEdeuFTatm5zIq5+qNN23vI= +github.com/prometheus/client_golang v1.20.4/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= +github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= +github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= +github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= +github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= -github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= -golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= -golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= -google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo= +golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0= +golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= +golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= +golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/logging/logger.go b/logging/logger.go index 12e46f3..ed007db 100644 --- a/logging/logger.go +++ b/logging/logger.go @@ -17,9 +17,9 @@ import ( // https://godoc.org/github.com/prometheus/common/promlog/flag func NewLogger(logfmt string, loglevel string) log.Logger { promLogLevel := &promlog.AllowedLevel{} - promLogLevel.Set(loglevel) + _ = promLogLevel.Set(loglevel) promLogFormat := &promlog.AllowedFormat{} - promLogFormat.Set(logfmt) + _ = promLogFormat.Set(logfmt) promlogConfig := &promlog.Config{ Level: promLogLevel, Format: promLogFormat, diff --git a/main.go b/main.go index 46427a6..521b3f9 100644 --- a/main.go +++ b/main.go @@ -30,7 +30,7 @@ func main() { logger := logging.NewLogger(*logfmt, *loglevel) // Search passenge instance. - level.Info(logger).Log(logging.Msg("Searching passenger instance.")) + _ = level.Info(logger).Log(logging.Msg("Searching passenger instance.")) c := passenger.Context{} factory := passenger.CreateFactory(c) server := factory.FindInstance() @@ -38,20 +38,20 @@ func main() { if server != nil { break } - level.Info(logger).Log(logging.Msg("passenger not found. wait 200ms.")) + _ = level.Info(logger).Log(logging.Msg("passenger not found. wait 200ms.")) time.Sleep(time.Millisecond * 200) server = factory.FindInstance() } if server == nil { - level.Error(logger).Log(logging.Msg("passenger not found.")) + _ = level.Error(logger).Log(logging.Msg("passenger not found.")) return } - level.Info(logger).Log(logging.Msg("Found passenger instance.")) + _ = level.Info(logger).Log(logging.Msg("Found passenger instance.")) // Collector setup. collector := metric.NewCollector(server, logger) prometheus.MustRegister(collector) - level.Info(logger).Log(logging.Msgf("Starting passenger-go-exporter[port %d]", *listenPort)) + _ = level.Info(logger).Log(logging.Msgf("Starting passenger-go-exporter[port %d]", *listenPort)) // HTTP Server setup. http.Handle("/metrics", promhttp.Handler()) @@ -64,6 +64,6 @@ func main() { }) err := http.ListenAndServe(fmt.Sprintf(":%d", *listenPort), nil) if err != nil { - level.Error(logger).Log(logging.Err(&err)) + _ = level.Error(logger).Log(logging.Err(&err)) } } diff --git a/main_test.go b/main_test.go index 1e2213a..6fbd217 100644 --- a/main_test.go +++ b/main_test.go @@ -24,7 +24,7 @@ func TestRun(t *testing.T) { } os.Setenv("PASSENGER_INSTANCE_REGISTRY_DIR", "/sock") - statusc := make(chan string) //startup message channel. + statusc := make(chan string) // startup message channel. runExporter(t, statusc) callPassengerApp(t) @@ -40,7 +40,7 @@ func TestRun(t *testing.T) { func TestRunNotFound(t *testing.T) { os.Setenv("PASSENGER_INSTANCE_REGISTRY_DIR", "/tmp") - statusc := make(chan string, 1) //startup message channel. + statusc := make(chan string, 1) // startup message channel. runExporter(t, statusc) @@ -116,11 +116,14 @@ func checkMetrics(t *testing.T, url string) { if !existsProcessCount { t.Fatal("not found passenger_go_process_count") - } else if !existsProcessProcessed { + } + if !existsProcessProcessed { t.Fatal("not found passenger_go_process_processed") - } else if !existsProcessRealMemory { + } + if !existsProcessRealMemory { t.Fatal("not found passenger_go_process_real_memory") - } else if !existsWaitListSie { + } + if !existsWaitListSie { t.Fatal("not found passenger_go_wait_list_size") } } diff --git a/metric/collector.go b/metric/collector.go index 022afe9..4a577af 100644 --- a/metric/collector.go +++ b/metric/collector.go @@ -48,8 +48,8 @@ func (collector *Collector) Describe(ch chan<- *prometheus.Desc) { func (collector *Collector) Collect(ch chan<- prometheus.Metric) { info, err := collector.server.Metrics() if err != nil { - level.Error(collector.logger).Log(logging.Err(&err)) - level.Error(collector.logger).Log(logging.Msg("restart process.")) + _ = level.Error(collector.logger).Log(logging.Err(&err)) + _ = level.Error(collector.logger).Log(logging.Msg("restart process.")) panic(err) } for _, sg := range info.SuperGroups { diff --git a/metric/collector_test.go b/metric/collector_test.go index 4e5120d..19f21d7 100644 --- a/metric/collector_test.go +++ b/metric/collector_test.go @@ -77,7 +77,7 @@ func TestCollectError(t *testing.T) { o := recover() v, ok := o.(error) if !ok || v.Error() != "mock error" { - assert.Fail(t, "unkown error", "unkown error [%+v]", o) + assert.Fail(t, "unknown error", "unknown error [%+v]", o) } }() diff --git a/passenger/passenger6_server_test.go b/passenger/passenger6_server_test.go index f25c0a0..1814d8d 100644 --- a/passenger/passenger6_server_test.go +++ b/passenger/passenger6_server_test.go @@ -59,7 +59,7 @@ func TestFindInstanceUsePassenger(t *testing.T) { factory := &Passenger6ServerFactory{} server := factory.FindInstance() - assert.NotNil(t, server) //because of not connect. + assert.NotNil(t, server) // because of not connect. pool, err := server.Metrics() assert.NotNil(t, pool) @@ -143,5 +143,5 @@ func TestFindInstanceXMLNotConnect(t *testing.T) { factory := &Passenger6ServerFactory{} server := factory.FindInstance() - assert.Nil(t, server) //because of not connect. + assert.Nil(t, server) // because of not connect. } diff --git a/test/e2e/e2e_test.go b/test/e2e/e2e_test.go index 7cefd14..d1328a2 100644 --- a/test/e2e/e2e_test.go +++ b/test/e2e/e2e_test.go @@ -48,7 +48,7 @@ func TestNotFoundPassengerRun(t *testing.T) { // runExporter executes passenger-go-exporter. func runExporter(t *testing.T) (*exec.Cmd, context.CancelFunc) { - statusc := make(chan string) //startup message channel. + statusc := make(chan string) // startup message channel. workdir, err := os.Getwd() if err != nil { @@ -157,11 +157,14 @@ func checkMetrics(t *testing.T, url string) { if !existsProcessCount { t.Fatal("not found passenger_go_process_count") - } else if !existsProcessProcessed { + } + if !existsProcessProcessed { t.Fatal("not found passenger_go_process_processed") - } else if !existsProcessRealMemory { + } + if !existsProcessRealMemory { t.Fatal("not found passenger_go_process_real_memory") - } else if !existsWaitListSie { + } + if !existsWaitListSie { t.Fatal("not found passenger_go_wait_list_size") } }