Skip to content

Commit

Permalink
Fix some health-configs in the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
joergdw committed Mar 17, 2023
1 parent 7084138 commit de0e65d
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/autoscaler/api/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ var _ = Describe("Config", func() {
},
},
))
Expect(conf.CredHelperImpl).To(Equal("default"))
Expect(conf.CredHelperImpl).To(Equal(Expect(conf.Health.UnprotectedEndpoints).To(
ContainElements("/", "/health/liveness","/health/prometheus",
})
})

Expand Down
2 changes: 2 additions & 0 deletions src/autoscaler/api/config/testdata/valid_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ db:
catalog_schema_path: '../schemas/catalog.schema.json'
catalog_path: '../exampleconfig/catalog-example.json'
policy_schema_path: '../exampleconfig/policy.schema.json'
health:
unprotected_endpoints: ["/", "/health/liveness", "/health/prometheus", "/debug/pprof"]
scheduler:
scheduler_url: https://localhost:8083
tls:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ var _ = Describe("Integration_Operator_Others", func() {
Consistently(func() bool { return activeScheduleExists(testAppId) }).
WithTimeout(10 * time.Second).
WithPolling(1 * time.Second).Should(BeTrue())

})

It("should delete an active schedule in scaling engine after restart", func() {
Expand Down
3 changes: 3 additions & 0 deletions src/autoscaler/metricsforwarder/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ db:
connection_max_lifetime: 60s
health:
port: 9999
unprotected_endpoints: ["/", "/health/liveness", "/health/prometheus", "/debug/pprof"]
cred_helper_impl: default
`)
})
Expand All @@ -75,6 +76,8 @@ cred_helper_impl: default
Expect(conf.Server.Port).To(Equal(8081))
Expect(conf.Logging.Level).To(Equal("debug"))
Expect(conf.Health.Port).To(Equal(9999))
Expect(conf.Health.UnprotectedEndpoints).To(
ContainElements("/", "/health/liveness", "/health/prometheus", "/debug/pprof"))
Expect(conf.LoggregatorConfig.MetronAddress).To(Equal("127.0.0.1:3457"))
Expect(conf.Db[db.PolicyDb]).To(Equal(
db.DatabaseConfig{
Expand Down
5 changes: 4 additions & 1 deletion src/autoscaler/operator/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"bytes"
"time"

"code.cloudfoundry.org/app-autoscaler/src/autoscaler/routes"
"code.cloudfoundry.org/app-autoscaler/src/autoscaler/testhelpers"

"code.cloudfoundry.org/app-autoscaler/src/autoscaler/db"
Expand Down Expand Up @@ -241,8 +242,10 @@ scheduler:
conf.AppSyncer.DB.URL = "postgres://pqgotest:password@exampl.com/pqgotest"
conf.DBLock.DB.URL = "postgres://pqgotest:password@exampl.com/pqgotest"
conf.HttpClientTimeout = 10 * time.Second
conf.Health.Port = 8081

conf.Health.Port = 8081
conf.Health.UnprotectedEndpoints = []string{"/", routes.LivenessPath,
routes.PrometheusPath, routes.PprofPath}
})

JustBeforeEach(func() {
Expand Down

0 comments on commit de0e65d

Please sign in to comment.