Skip to content

Commit

Permalink
feat: bump golang up to 1.23
Browse files Browse the repository at this point in the history
  • Loading branch information
h-r-k-matsumoto committed Sep 22, 2024
1 parent f85ca0b commit 459ed29
Show file tree
Hide file tree
Showing 14 changed files with 85 additions and 80 deletions.
4 changes: 2 additions & 2 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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
14 changes: 5 additions & 9 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down Expand Up @@ -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.
Expand All @@ -96,8 +94,6 @@ linters-settings:
enable:
- asciicheck
- misspell
- maligned
- golint
- gofmt
- gocyclo
- gocritic
Expand Down
2 changes: 1 addition & 1 deletion doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
24 changes: 13 additions & 11 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
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
)

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
)
55 changes: 28 additions & 27 deletions go.sum
Original file line number Diff line number Diff line change
@@ -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=
4 changes: 2 additions & 2 deletions logging/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
12 changes: 6 additions & 6 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,28 +30,28 @@ 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()
for i := 0; i < 20; i++ {
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())
Expand All @@ -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))
}
}
13 changes: 8 additions & 5 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)

Expand Down Expand Up @@ -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")
}
}
Expand Down
4 changes: 2 additions & 2 deletions metric/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion metric/collector_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}()

Expand Down
4 changes: 2 additions & 2 deletions passenger/passenger6_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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.
}
11 changes: 7 additions & 4 deletions test/e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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")
}
}
Expand Down

0 comments on commit 459ed29

Please sign in to comment.