generated from RedHatQE/python-template-repository
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add odh_model_controller deployment smoke tests (#39)
* add odh_model_controller smoke tests * add comments --------- Co-authored-by: Milind Waykole <[email protected]>
- Loading branch information
Showing
4 changed files
with
35 additions
and
1 deletion.
There are no files selected for viewing
Empty file.
31 changes: 31 additions & 0 deletions
31
tests/model_serving/model_server/operator/test_operator.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import pytest | ||
from kubernetes.dynamic import DynamicClient | ||
from ocp_resources.deployment import Deployment | ||
from ocp_resources.exceptions import MissingResourceResError | ||
|
||
from utilities.constants import APPLICATIONS_NAMESPACE | ||
|
||
|
||
@pytest.fixture(scope="class") | ||
def odh_model_controller_deployment(admin_client: DynamicClient): | ||
deployment = Deployment( | ||
client=admin_client, | ||
name="odh-model-controller", | ||
namespace=APPLICATIONS_NAMESPACE, | ||
) | ||
if deployment.exists: | ||
return deployment | ||
|
||
raise MissingResourceResError(name=deployment.name) | ||
|
||
|
||
class TestOperator: | ||
@pytest.mark.smoke | ||
def test_odh_model_controller_deployment(self, odh_model_controller_deployment): | ||
# Check odh-model-controller deployment expected number of replicas | ||
assert odh_model_controller_deployment.instance.spec.replicas == 1 | ||
|
||
@pytest.mark.smoke | ||
def test_odh_model_controller_replicas(self, odh_model_controller_deployment): | ||
# Check odh-model-controller deployment replicas are running | ||
odh_model_controller_deployment.wait_for_replicas() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
APPLICATIONS_NAMESPACE: str = "redhat-ods-applications" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters