Skip to content

Commit 6be7d55

Browse files
test/e2e: Reduce subscription e2e test pollution (#2438)
* fix(e2e): Run each test in subscription in different namespace All test cases in subscription suite shares the same test namespace. In some cases, the resource cleanup which doesn't work properly from previous test causes failure on subsequent test. This commit will create new namespace for each test so it can be run in insolation. Signed-off-by: Vu Dinh <[email protected]> * test/e2e: Minor updates to the test namespace generation function - Update the helper function SetUpGeneratedTestNamespace -> SetupGeneratedTestNamespace. - Update SetupGeneratedTestNamespace to only return a corev1.Namespace object. Call sites can access the generated namespace by indexing into the object's GetName() method or the metdata.Name field. - Update SetupGeneratedTestNamespace and remove the logic that generates the namespace's metadata.name in the function. Call sites are responsible for generating a unique name now. - Update any subscription e2e tests to use the returned corev1.Namespace resource's GetName() method. - Remove the usage of the TearDown helper function in the subscription e2e suite. Generated namespaces (and their underlying testing resources) are cleaned up by deleting the namespace itself. Signed-off-by: timflannagan <[email protected]> * test/e2e: Remove duplicate package import in util_test.go Remove duplicate package import for the operator v1alpha1 API library. Signed-off-by: timflannagan <[email protected]> * test/e2e: Replace instances of context.TODO with context.Background Update the subscription and util e2e packages and replace any instances of context.TODO() with context.Background(). Signed-off-by: timflannagan <[email protected]> * test/e2e: Remove duplicate OperatorGroup being created in the 'can reconcile InstallPlan status' test The 'can reconcile InstallPlan status' test case creates a custom OG that targets the namespace that was created. This leads to the following error message being logged in CI: ``log 2021-11-09T03:05:18.130980249Z stderr F E1109 03:05:18.130887 1 queueinformer_operator.go:290] sync {"update" "subscription-e2e-9bxh2/install-mqx5p"} failed: attenuated service account query failed - more than one operator group(s) are managing this namespace count=2 2021-11-09T03:05:18.130992349Z stderr F time="2021-11-09T03:05:18Z" level=info msg=syncing id=XXo2z ip=install-mqx5p namespace=subscription-e2e-9bxh2 phase=Installing ``` Remove this custom OG and use the OG that was created in the BeforeEach clause instead. Signed-off-by: timflannagan <[email protected]> Co-authored-by: Vu Dinh <[email protected]>
1 parent 58c8485 commit 6be7d55

File tree

2 files changed

+349
-338
lines changed

2 files changed

+349
-338
lines changed

0 commit comments

Comments
 (0)