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

Add e2e tests for Operator #201

Conversation

VaishnaviHire
Copy link
Member

Description

This PR introduces e2e testing to the operator. It tests following use cases:

  • Validating Operator Deployment
  • Creation of KfDef
  • Validating labels and annotations in the managed resources
  • Validating that changes to the managed resources are reverted
  • Validating deletion of KfDef and its managed resources

How Has This Been Tested?

Testing Instructions: Run-e2e section in README.md

Note:

There are additional use cases that are more involved and can be added to this test-suite as part of follow-up PRs/issues

  • The commits are squashed in a cohesive manner and have meaningful messages.
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has manually tested the changes and verified that the changes work

@VaishnaviHire
Copy link
Member Author

Output from local run:

 ✗ make e2e-test
warning: GOPATH set to GOROOT (/Users/vhire/go/go1.18.9) has no effect
go test ./tests/e2e/ -run ^TestOdhOperator -v --kf-namespace=odh-e2e-test "--skip-deletion=false" 
warning: GOPATH set to GOROOT (/Users/vhire/go/go1.18.9) has no effect
=== RUN   TestOdhOperator
=== RUN   TestOdhOperator/validate_controllers
=== RUN   TestOdhOperator/validate_controllers/Validate_KfDef_controller
=== RUN   TestOdhOperator/validate_controllers/Validate_CRDs_owned_by_the_operator
=== RUN   TestOdhOperator/create
=== RUN   TestOdhOperator/create/e2e-test
=== RUN   TestOdhOperator/create/e2e-test/Creation_of_KfDef_instance
=== RUN   TestOdhOperator/create/e2e-test/Validate_deployed_applications
=== RUN   TestOdhOperator/create/e2e-test/Validate_deployed_applications/Validate_deployments_for_application_odh-dashboard
2023/02/27 15:23:38 waiting for application deployments to be in Ready state.
2023/02/27 15:23:48 waiting for application deployments to be in Ready state.
2023/02/27 15:23:58 waiting for application deployments to be in Ready state.
2023/02/27 15:24:08 waiting for application deployments to be in Ready state.
2023/02/27 15:24:18 waiting for application deployments to be in Ready state.
2023/02/27 15:24:28 waiting for application deployments to be in Ready state.
2023/02/27 15:24:38 waiting for application deployments to be in Ready state.
=== RUN   TestOdhOperator/create/e2e-test/Validate_KfDef_Annotation_is_added
=== RUN   TestOdhOperator/create/e2e-test/Validate_Controller_Reverts_Updates
=== RUN   TestOdhOperator/delete
=== RUN   TestOdhOperator/delete/e2e-test
=== RUN   TestOdhOperator/delete/e2e-test/KfDef_Deletion
=== RUN   TestOdhOperator/delete/e2e-test/Application_Resource_Deletion
=== RUN   TestOdhOperator/delete/e2e-test/Application_Resource_Deletion/Validate_deletion_for_application_odh-dashboard
--- PASS: TestOdhOperator (209.04s)
    --- PASS: TestOdhOperator/validate_controllers (63.04s)
        --- PASS: TestOdhOperator/validate_controllers/Validate_KfDef_controller (10.05s)
        --- PASS: TestOdhOperator/validate_controllers/Validate_CRDs_owned_by_the_operator (50.21s)
    --- PASS: TestOdhOperator/create (113.09s)
        --- PASS: TestOdhOperator/create/e2e-test (110.45s)
            --- PASS: TestOdhOperator/create/e2e-test/Creation_of_KfDef_instance (10.10s)
            --- PASS: TestOdhOperator/create/e2e-test/Validate_deployed_applications (80.05s)
                --- PASS: TestOdhOperator/create/e2e-test/Validate_deployed_applications/Validate_deployments_for_application_odh-dashboard (80.05s)
            --- PASS: TestOdhOperator/create/e2e-test/Validate_KfDef_Annotation_is_added (0.15s)
            --- PASS: TestOdhOperator/create/e2e-test/Validate_Controller_Reverts_Updates (20.15s)
    --- PASS: TestOdhOperator/delete (32.90s)
        --- PASS: TestOdhOperator/delete/e2e-test (30.25s)
            --- PASS: TestOdhOperator/delete/e2e-test/KfDef_Deletion (0.10s)
            --- PASS: TestOdhOperator/delete/e2e-test/Application_Resource_Deletion (30.15s)
                --- PASS: TestOdhOperator/delete/e2e-test/Application_Resource_Deletion/Validate_deletion_for_application_odh-dashboard (30.15s)
PASS
ok      github.com/opendatahub-io/opendatahub-operator/tests/e2e        209.676s

Copy link
Contributor

@LaVLaS LaVLaS left a comment

Choose a reason for hiding this comment

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

/lgtm

Running make deploy e2e-test worked for me with no issues

@openshift-ci
Copy link

openshift-ci bot commented Feb 28, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: LaVLaS

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit ebec2bf into opendatahub-io:feature/update-sdk Feb 28, 2023
VaishnaviHire added a commit that referenced this pull request Mar 29, 2023
VaishnaviHire added a commit to VaishnaviHire/opendatahub-operator that referenced this pull request Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants