Skip to content

Create dedicated namespaces per test case in reconcilers tests #849

Open
@souleb

Description

@souleb

Create dedicated namespaces per test case, then delete the whole NS at the end. This will help avoid the case where we fail to stop the kube-apiserver.

for example:

namedNS, err := testEnv.CreateNamespace(context.TODO(), mockReleaseNamespace)
			g.Expect(err).NotTo(HaveOccurred())
			t.Cleanup(func() {
				_ = testEnv.Delete(context.TODO(), namedNS)
			})

https://github.com/fluxcd/helm-controller/blob/5d28aa42505641652648e338afc9c1ec4e8dfb55/internal/reconcile/install_test.go#L183

Metadata

Metadata

Assignees

Labels

area/testingTesting related issues and pull requestsgood first issueGood for newcomershelp wantedExtra attention is needed

Type

No type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions