Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Functional test for dbpurge job #896

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions test/functional/novaconductor_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,8 @@ var _ = Describe("NovaConductor controller", func() {
k8sClient.Delete, ctx, CreateDefaultCellInternalSecret(cell0))

spec := GetDefaultNovaConductorSpec(cell0)
newSelector := map[string]string{"foo": "bar"}
spec["nodeSelector"] = &newSelector
DeferCleanup(th.DeleteInstance, CreateNovaConductor(cell0.ConductorName, spec))

th.ExpectCondition(
Expand Down Expand Up @@ -376,6 +378,11 @@ var _ = Describe("NovaConductor controller", func() {
Equal(fmt.Sprintf("%d", *conductor.Spec.DBPurge.ArchiveAge)))
Expect(GetEnvVarValue(jobEnv, "PURGE_AGE", "")).To(
Equal(fmt.Sprintf("%d", *conductor.Spec.DBPurge.PurgeAge)))
service := cron.Spec.JobTemplate.Labels["service"]
Expect(service).To(Equal("nova-conductor"))
nodeSelector := cron.Spec.JobTemplate.Spec.Template.Spec.NodeSelector
auniyal61 marked this conversation as resolved.
Show resolved Hide resolved
Expect(nodeSelector).NotTo(BeNil())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We want to test that the NodeSelector from the NovaConductor Spec is passed to the DB purge job's NodeSelector.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe what Gibi meant was to check if this is the same NodeSelector as in NovaConductorSpec. Please verify and ensure they are identical

Expect(nodeSelector).To(Equal(map[string]string{"foo": "bar"}))

th.ExpectCondition(
cell0.ConductorName,
Expand Down