Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
Leonid Podolinskiy committed Oct 3, 2023
1 parent 8ad162b commit fb2b7f6
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion internal/controller/lightrunjavaagent_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package controller

import (
"context"
"fmt"
"time"

agentsv1beta "github.com/lightrun-platform/lightrun-k8s-operator/api/v1beta"
Expand Down Expand Up @@ -34,7 +35,13 @@ var _ = Describe("LightrunJavaAgent controller", func() {
agentCliFlags = "--lightrun_extra_class_path=<PATH_TO_JAR>"
)
var containerSelector = []string{"app", "app2"}
var agentConfig map[string]string = map[string]string{"max_log_cpu_cost": "2"}
var agentConfig map[string]string = map[string]string{
"max_log_cpu_cost": "2",
"some_config": "1",
"some_other_config": "2",
"some_yet_another_config": "1",

}
var agentTags []string = []string{"new_tag", "prod"}
var secretData map[string]string = map[string]string{
"LIGHTRUN_KEY": "some_key",
Expand Down Expand Up @@ -336,6 +343,11 @@ var _ = Describe("LightrunJavaAgent controller", func() {
return flag == 2
}).Should(BeTrue())
})
It("Should not change hash of the configmap in the deployment metadata", func() {
Eventually(func() bool {
return patchedDepl.Spec.Template.Annotations["lightrun.com/configmap-hash"] == fmt.Sprint(hash(cm.Data["config"]+cm.Data["metadata"]))
}).Should(BeTrue())
})

It("Should add finalizer to first CRD", func() {
Eventually(func() bool {
Expand Down

0 comments on commit fb2b7f6

Please sign in to comment.