Skip to content

Commit

Permalink
Review-fixes -> cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
asalan316 committed Oct 28, 2024
1 parent 8e785c2 commit 3191dfc
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 14 deletions.
9 changes: 0 additions & 9 deletions src/acceptance/app/custom_metric_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ var _ = Describe("AutoScaler custom metrics", func() {
// This test will fail if credential-type is set to X509 in autoscaler broker.
// Therefore, only mtls connection will be supported for custom metrics in future
Context("when scaling by custom metrics", func() {
BeforeEach(func() {
//instanceName = CreatePolicy(cfg, appToScaleName, appToScaleGUID, policy)
//StartApp(appToScaleName, cfg.CfPushTimeoutDuration())
})
It("should scale out and scale in", Label(acceptance.LabelSmokeTests), func() {
By("Scale out to 2 instances")
scaleOut := sendMetricToAutoscaler(cfg, appToScaleGUID, appToScaleName, 550, false)
Expand All @@ -57,10 +53,6 @@ var _ = Describe("AutoScaler custom metrics", func() {
})

Context("when scaling by custom metrics via mtls", func() {
BeforeEach(func() {
//instanceName = CreatePolicy(cfg, appToScaleName, appToScaleGUID, policy)
//StartApp(appToScaleName, cfg.CfPushTimeoutDuration())
})
It("should scale out and scale in", Label(acceptance.LabelSmokeTests), func() {
By("Scale out to 2 instances")
scaleOut := sendMetricToAutoscaler(cfg, appToScaleGUID, appToScaleName, 550, true)
Expand Down Expand Up @@ -114,7 +106,6 @@ var _ = Describe("AutoScaler custom metrics", func() {
WithTimeout(5 * time.Minute).
WithPolling(15 * time.Second).
Should(Equal(1))

})
})
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,11 @@ func (*CustomMetricAPIClient) PostCustomMetric(ctx context.Context, logger logr.
if err != nil {
return fmt.Errorf("cloud foundry environment not found %w", err)
}
// appToScale is provided i.e. producer and consumer app relationship
if appConfig != nil && appConfig.AppID != "" {
logger.Info("producer-app-relationship-found", "appToScaleGuid", appConfig.AppID)
//assuming the producer app has the same autoscaler service credentials as appToScale
appConfig.Services = currentApp.Services
}
if appConfig.AppID == "" {
} else { // metric producer = appToScale (default case)
appConfig = currentApp
}
appId := api.GUID(appConfig.AppID)
Expand Down
1 change: 0 additions & 1 deletion src/acceptance/broker/broker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ var _ = Describe("AutoScaler Service Broker", func() {
It("binds&unbinds with configurations and policy", func() {
policyFile := "../assets/file/policy/policy-with-configuration.json"
policy, err := os.ReadFile(policyFile)
fmt.Println("policy", string(policy)) //FIXME
Expect(err).NotTo(HaveOccurred())

err = helpers.BindServiceToAppWithPolicy(cfg, appName, instance.name(), policyFile)
Expand Down
1 change: 0 additions & 1 deletion src/autoscaler/metricsforwarder/server/auth/auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ var _ = Describe("Authentication", func() {
testAppId = "app-to-scale-id"
vars["appid"] = testAppId
req.Header.Add("X-Forwarded-Client-Cert", MustReadXFCCcert(validClientCert2))
// ToDO: this should be read via configurations aka scaling policy binding parameters
fakeBindingDB.GetCustomMetricStrategyByAppIdReturns("bound_app", nil)
nextCalled := 0
nextFunc := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
Expand Down

0 comments on commit 3191dfc

Please sign in to comment.