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

test/e2e: Reduce subscription e2e test pollution #2438

Commits on Nov 3, 2021

  1. 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 <vudinh@outlook.com>
    dinhxuanvu committed Nov 3, 2021
    Configuration menu
    Copy the full SHA
    bef2f14 View commit details
    Browse the repository at this point in the history

Commits on Nov 9, 2021

  1. 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 <timflannagan@gmail.com>
    timflannagan committed Nov 9, 2021
    Configuration menu
    Copy the full SHA
    2b4a3ea View commit details
    Browse the repository at this point in the history
  2. test/e2e: Remove duplicate package import in util_test.go

    Remove duplicate package import for the operator v1alpha1 API library.
    
    Signed-off-by: timflannagan <timflannagan@gmail.com>
    timflannagan committed Nov 9, 2021
    Configuration menu
    Copy the full SHA
    de4e4b3 View commit details
    Browse the repository at this point in the history
  3. 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 <timflannagan@gmail.com>
    timflannagan committed Nov 9, 2021
    Configuration menu
    Copy the full SHA
    4c36306 View commit details
    Browse the repository at this point in the history
  4. test/e2e: Remove duplicate OperatorGroup being created in the 'can re…

    …concile 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 <timflannagan@gmail.com>
    timflannagan committed Nov 9, 2021
    Configuration menu
    Copy the full SHA
    2563e69 View commit details
    Browse the repository at this point in the history