-
Notifications
You must be signed in to change notification settings - Fork 49
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
Refactor integration test suite to use testify #589
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worked perfectly fine for complete integration test but the test case where we skip the DSPA install using the flag fails as it expects a DSPA named test-dspa
. Is that a requirement?
Full Test Case
go test ./... --tags=test_integration -v -kubeconfig=${KUBECONFIG_PATH} -k8sApiServerHost=${TARGET_CLUSTER} -DSPANamespace=${TARGET_NAMESPACE} -DSPAPath=resources/dspa-lite.yaml
? github.com/opendatahub-io/data-science-pipelines-operator [no test files]
? github.com/opendatahub-io/data-science-pipelines-operator/api/v1alpha1 [no test files]
? github.com/opendatahub-io/data-science-pipelines-operator/controllers [no test files]
? github.com/opendatahub-io/data-science-pipelines-operator/controllers/config [no test files]
? github.com/opendatahub-io/data-science-pipelines-operator/controllers/testutil [no test files]
? github.com/opendatahub-io/data-science-pipelines-operator/controllers/util [no test files]
? github.com/opendatahub-io/data-science-pipelines-operator/tests/util [no test files]
=== RUN TestIntegrationTestSuite
SetupSuite started
2024-03-12T23:49:09+05:30 INFO Deploying DSPA...
2024-03-12T23:49:10+05:30 INFO Waiting for DSPA pods to ready...
2024-03-12T23:50:40+05:30 INFO DSPA Deployed.
2024-03-12T23:50:40+05:30 INFO Setting up Portforwarding service.
Forwarding service: ds-pipeline-test-dspa to pod ds-pipeline-test-dspa-77d8ff84cd-nmp25 ...
Forwarding from 127.0.0.1:8888 -> 8888
Forwarding from [::1]:8888 -> 8888
2024-03-12T23:50:42+05:30 INFO Portforwarding service Successfully set up.
SetupSuite completed
=== RUN TestIntegrationTestSuite/TestAPIServerDeployment
=== RUN TestIntegrationTestSuite/TestAPIServerDeployment/Should_successfully_fetch_pipelines
Handling connection for 8888
2024-03-12T23:50:43+05:30 INFO {"pipelines":[{"pipeline_id":"a4c0a3aa-c953-4b21-80cd-fabf0629a898","display_name":"[Demo] iris-training","description":"[source code](https://github.com/opendatahub-io/data-science-pipelines/tree/master/samples/iris-sklearn) A simple pipeline to demonstrate a basic ML Training workflow","created_at":"2024-03-12T18:20:32Z"}],"total_size":1}
=== RUN TestIntegrationTestSuite/TestAPIServerDeployment/Should_successfully_upload_a_pipeline
2024-03-12T23:50:44+05:30 INFO {"pipeline_id":"74c97e0f-fb39-4d1a-9a5a-ac239fabab3f","display_name":"test-pipeline-run.yaml","created_at":"2024-03-12T18:20:43Z"}
=== RUN TestIntegrationTestSuite/TestDSPADeployment
=== RUN TestIntegrationTestSuite/TestDSPADeployment/with_default_MariaDB_and_Minio
=== RUN TestIntegrationTestSuite/TestDSPADeployment/with_default_MariaDB_and_Minio/should_have_8_pods
=== RUN TestIntegrationTestSuite/TestDSPADeployment/with_default_MariaDB_and_Minio/should_have_a_ready_ds-pipeline-test-dspa_deployment
=== RUN TestIntegrationTestSuite/TestDSPADeployment/with_default_MariaDB_and_Minio/should_have_a_ready_ds-pipeline-persistenceagent-test-dspa_deployment
=== RUN TestIntegrationTestSuite/TestDSPADeployment/with_default_MariaDB_and_Minio/should_have_a_ready_ds-pipeline-scheduledworkflow-test-dspa_deployment
=== RUN TestIntegrationTestSuite/TestDSPADeployment/with_default_MariaDB_and_Minio/should_have_a_ready_mariadb-test-dspa_deployment
=== RUN TestIntegrationTestSuite/TestDSPADeployment/with_default_MariaDB_and_Minio/should_have_a_ready_minio-test-dspa_deployment
=== RUN TestIntegrationTestSuite/TestFetchExperiments
=== RUN TestIntegrationTestSuite/TestFetchExperiments/Should_successfully_fetch_experiments
2024-03-12T23:50:47+05:30 INFO {"experiments":[{"experiment_id":"125e7b72-4ddc-4cd9-b17f-bc93a548ffa8","display_name":"Default","description":"All runs created without specifying an experiment will be grouped here.","created_at":"2024-03-12T18:20:34Z","storage_state":"AVAILABLE"}],"total_size":1}
--- PASS: TestIntegrationTestSuite (100.86s)
--- PASS: TestIntegrationTestSuite/TestAPIServerDeployment (1.82s)
--- PASS: TestIntegrationTestSuite/TestAPIServerDeployment/Should_successfully_fetch_pipelines (0.82s)
--- PASS: TestIntegrationTestSuite/TestAPIServerDeployment/Should_successfully_upload_a_pipeline (1.00s)
--- PASS: TestIntegrationTestSuite/TestDSPADeployment (2.78s)
--- PASS: TestIntegrationTestSuite/TestDSPADeployment/with_default_MariaDB_and_Minio (2.78s)
--- PASS: TestIntegrationTestSuite/TestDSPADeployment/with_default_MariaDB_and_Minio/should_have_8_pods (1.15s)
--- PASS: TestIntegrationTestSuite/TestDSPADeployment/with_default_MariaDB_and_Minio/should_have_a_ready_ds-pipeline-test-dspa_deployment (0.54s)
--- PASS: TestIntegrationTestSuite/TestDSPADeployment/with_default_MariaDB_and_Minio/should_have_a_ready_ds-pipeline-persistenceagent-test-dspa_deployment (0.28s)
--- PASS: TestIntegrationTestSuite/TestDSPADeployment/with_default_MariaDB_and_Minio/should_have_a_ready_ds-pipeline-scheduledworkflow-test-dspa_deployment (0.27s)
--- PASS: TestIntegrationTestSuite/TestDSPADeployment/with_default_MariaDB_and_Minio/should_have_a_ready_mariadb-test-dspa_deployment (0.27s)
--- PASS: TestIntegrationTestSuite/TestDSPADeployment/with_default_MariaDB_and_Minio/should_have_a_ready_minio-test-dspa_deployment (0.27s)
--- PASS: TestIntegrationTestSuite/TestFetchExperiments (0.72s)
--- PASS: TestIntegrationTestSuite/TestFetchExperiments/Should_successfully_fetch_experiments (0.72s)
PASS
ok github.com/opendatahub-io/data-science-pipelines-operator/tests 100.873s
Test case skipping the DSPA install with the flag
go test ./... --tags=test_integration -v -kubeconfig=${KUBECONFIG_PATH} -k8sApiServerHost=${TARGET_CLUSTER} -DSPANamespace=${TARGET_NAMESPACE} -DSPAPath=resources/dspa-lite.yaml -skipDeploy=true -skipCleanup=true
? github.com/opendatahub-io/data-science-pipelines-operator [no test files]
? github.com/opendatahub-io/data-science-pipelines-operator/api/v1alpha1 [no test files]
? github.com/opendatahub-io/data-science-pipelines-operator/controllers [no test files]
? github.com/opendatahub-io/data-science-pipelines-operator/controllers/config [no test files]
? github.com/opendatahub-io/data-science-pipelines-operator/controllers/testutil [no test files]
? github.com/opendatahub-io/data-science-pipelines-operator/controllers/util [no test files]
? github.com/opendatahub-io/data-science-pipelines-operator/tests/util [no test files]
=== RUN TestIntegrationTestSuite
SetupSuite started
suite_test.go:158:
Error Trace: /tmp/tmp.xhMjGe55ls/data-science-pipelines-operator/tests/suite_test.go:158
/home/amadhusu/kogitooperator/go/pkg/pkg/mod/github.com/stretchr/testify@v1.8.3/suite/suite.go:154
/tmp/tmp.xhMjGe55ls/data-science-pipelines-operator/tests/suite_test.go:193
Error: Received unexpected error:
datasciencepipelinesapplications.datasciencepipelinesapplications.opendatahub.io "test-dspa" not found
Test: TestIntegrationTestSuite
2024-03-13T00:02:10+05:30 INFO DSPA Deployed.
2024-03-13T00:02:10+05:30 INFO Setting up Portforwarding service.
suite_test.go:172:
Error Trace: /tmp/tmp.xhMjGe55ls/data-science-pipelines-operator/tests/suite_test.go:172
/home/amadhusu/kogitooperator/go/pkg/pkg/mod/github.com/stretchr/testify@v1.8.3/suite/suite.go:154
/tmp/tmp.xhMjGe55ls/data-science-pipelines-operator/tests/suite_test.go:193
Error: Received unexpected error:
services "ds-pipeline-test-dspa" not found
Test: TestIntegrationTestSuite
--- FAIL: TestIntegrationTestSuite (2.43s)
FAIL
FAIL github.com/opendatahub-io/data-science-pipelines-operator/tests 2.443s
FAIL
Yep, this is expected. Basically the skip deploy command works when you have a DSPA instance already up with a DSP CR named "test-dspa". Hence it would fail on not finding that CR. |
@diegolovison should review this as well, as he'll need to update the test script that runs downstream |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: amadhusu, gmfrasca 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 |
/hold |
The issue resolved by this Pull Request:
Resolves https://issues.redhat.com/browse/RHOAIENG-1672
Description of your changes:
Convert integration tests to leverage testify instead of gomega/ginkgo.
Testing instructions
Deploy DSPO. In a fresh namespace, run the following command:
For the impatient developer, you can use the following flag to skip DSPA install. This is useful when you want to make changes to a live environment and run the tests against it:
Checklist