Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
9984343
feat: Add test to verify TrustyAIService works with multiple ns (#347)
adolfo-ab Jun 11, 2025
dd44827
Switch to using adming_client for IG tests (#346)
israel-hdez Jun 11, 2025
833706b
feat: add image validation for trustyai operator and service (#348)
sheltoncyril Jun 12, 2025
9b64792
Test LMEval and Guardrails orchestrator images (#350)
sheltoncyril Jun 13, 2025
77bd770
No commented-by label should be added for supported actions (#351)
dbasunag Jun 13, 2025
270c710
feat: replace Qwen2.5 image used in guardrails tests (#352)
adolfo-ab Jun 16, 2025
de51dea
chore(deps): lock file maintenance (#353)
renovate[bot] Jun 16, 2025
f3f5e4d
Download oc from the cluster and use the same (#349)
dbasunag Jun 16, 2025
8f14e7a
restrict coderabbit reviews on prs that are not ready or are created …
dbasunag Jun 17, 2025
453d98c
Simplify RBAC tests (#354)
dbasunag Jun 17, 2025
5e8f03c
adding e2e tests for openshift route timeout (#332)
brettmthompson Jun 17, 2025
e7aee74
feat: switch to oauth for all tests, fix negative tests (#358)
lugi0 Jun 18, 2025
dcb3e2b
feat: add tests for guardrails builtin detectors (#357)
adolfo-ab Jun 18, 2025
993a837
fix: redact sensitive strings (#360)
adolfo-ab Jun 19, 2025
b3b3d64
fix: remove temperature argument from guardrails request (#365)
adolfo-ab Jun 19, 2025
1a1772f
test: add test to initiate mr with secure db connection (#320)
fege Jun 19, 2025
93d3972
remove version check for validate_authorino_operator_version_channel …
dbasunag Jun 20, 2025
89d8128
fix: add missing fixtures to guardrails img test (#368)
adolfo-ab Jun 20, 2025
04a254e
remove cert verification for oc download (#366)
dbasunag Jun 20, 2025
5612dde
chore(deps): lock file maintenance (#373)
renovate[bot] Jun 23, 2025
3421741
[pre-commit.ci] pre-commit autoupdate (#374)
pre-commit-ci[bot] Jun 23, 2025
092df55
Add OSSM rest api test for regression check (#367)
dbasunag Jun 24, 2025
9fe8c0e
test: add REST and gRPC test suite for Seldon MLServer runtime (#328)
Snomaan6846 Jun 24, 2025
76f9ac7
skip
Jun 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .coderabbit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ reviews:
auto_review:
enabled: true
auto_incremental_review: true
ignore_title_keywords: []
ignore_title_keywords: ['wip', 'do not merge', 'do not review',
'lock file maintenance', 'pre-commit autoupdate']
labels: []
drafts: false
base_branches: []
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/scripts/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
f"{LABEL_PREFIX}{LGTM_LABEL_STR}",
f"{LABEL_PREFIX}{VERIFIED_LABEL_STR}",
f"{LABEL_PREFIX}{HOLD_LABEL_STR}",
f"{LABEL_PREFIX}build-push-pr-image",
f"{LABEL_PREFIX}cherry-pick",
}

CANCEL_ACTION: str = "cancel"
Expand All @@ -38,7 +40,7 @@
`verified` label removed on each new commit push.
* To Cherry-pick a merged PR `/cherry-pick <target_branch_name>` to the PR. If <target_branch_name> is valid,
and the current PR is merged, a cherry-picked PR would be created and linked to the current PR.
* To build and push image to quay, add /build-push-pr-image in a comment. This would create an image with tag
* To build and push image to quay, add `/build-push-pr-image` in a comment. This would create an image with tag
pr-<pr_number> to quay repository. This image tag, however would be deleted on PR merge or close action.

<details>
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ repos:
- id: check-toml

- repo: https://github.com/PyCQA/flake8
rev: "7.2.0"
rev: "7.3.0"
hooks:
- id: flake8
args: [--config=.flake8]
Expand All @@ -35,7 +35,7 @@ repos:
- id: detect-secrets

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.11.13
rev: v0.12.0
hooks:
- id: ruff
- id: ruff-format
Expand All @@ -54,7 +54,7 @@ repos:
- id: gitleaks

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.16.0
rev: v1.16.1
hooks:
- id: mypy
additional_dependencies: ["types-PyYAML", "types-requests"]
Expand Down
13 changes: 0 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,6 @@ RUN apt-get update \
&& apt-get autoremove --yes \
&& rm -rf /var/lib/{apt,dpkg,cache,log}/

# Install the Rosa CLI
RUN curl -L https://mirror.openshift.com/pub/openshift-v4/clients/rosa/latest/rosa-linux.tar.gz --output /tmp/rosa-linux.tar.gz \
&& tar xvf /tmp/rosa-linux.tar.gz --no-same-owner \
&& mv rosa /usr/bin/rosa \
&& chmod +x /usr/bin/rosa \
&& rosa version

# Install the OpenShift CLI (OC)
RUN curl -L https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/stable/openshift-client-linux.tar.gz --output /tmp/openshift-client-linux.tar.gz \
&& tar xvf /tmp/openshift-client-linux.tar.gz --no-same-owner \
&& mv oc /usr/bin/oc \
&& chmod +x /usr/bin/oc

# Install grpcurl
RUN curl -sSL "https://github.com/fullstorydev/grpcurl/releases/download/v1.9.2/grpcurl_1.9.2_linux_x86_64.tar.gz" --output /tmp/grpcurl_1.2.tar.gz \
&& tar xvf /tmp/grpcurl_1.2.tar.gz --no-same-owner \
Expand Down
7 changes: 6 additions & 1 deletion conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@
collect_rhoai_must_gather,
get_base_dir,
)

from kubernetes.dynamic import DynamicClient
from utilities.infra import get_operator_distribution, get_dsci_applications_namespace, get_data_science_cluster
from ocp_resources.resource import get_client


LOGGER = logging.getLogger(name=__name__)
BASIC_LOGGER = logging.getLogger(name="basic")

Expand Down Expand Up @@ -106,6 +106,11 @@ def pytest_addoption(parser: Parser) -> None:
default=os.environ.get("VLLM_RUNTIME_IMAGE"),
help="Specify the runtime image to use for the tests",
)
runtime_group.addoption(
"--mlserver-runtime-image",
default=os.environ.get("MLSERVER_RUNTIME_IMAGE"),
help="Specify the runtime image to use for the tests",
)

# Upgrade options
upgrade_group.addoption(
Expand Down
62 changes: 59 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import pytest
import shortuuid
import yaml
from _pytest._py.path import LocalPath
from _pytest.legacypath import TempdirFactory
from _pytest.tmpdir import TempPathFactory
from ocp_resources.config_map import ConfigMap
from ocp_resources.dsc_initialization import DSCInitialization
Expand All @@ -32,6 +34,7 @@
create_ns,
login_with_user_password,
get_openshift_token,
download_oc_console_cli,
)
from utilities.constants import (
AcceleratorType,
Expand All @@ -41,7 +44,9 @@
Protocols,
)
from utilities.infra import update_configmap_data
from utilities.logger import RedactedString
from utilities.minio import create_minio_data_connection_secret
from utilities.operator_utils import get_csv_related_images

LOGGER = get_logger(name=__name__)

Expand All @@ -64,7 +69,7 @@ def tests_tmp_dir(request: FixtureRequest, tmp_path_factory: TempPathFactory) ->

@pytest.fixture(scope="session")
def current_client_token(admin_client: DynamicClient) -> str:
return get_openshift_token()
return RedactedString(value=get_openshift_token())


@pytest.fixture(scope="session")
Expand Down Expand Up @@ -216,6 +221,14 @@ def vllm_runtime_image(pytestconfig: pytest.Config) -> str | None:
return runtime_image


@pytest.fixture(scope="session")
def mlserver_runtime_image(pytestconfig: pytest.Config) -> str | None:
runtime_image = pytestconfig.option.mlserver_runtime_image
if not runtime_image:
return None
return runtime_image


@pytest.fixture(scope="session")
def use_unprivileged_client(pytestconfig: pytest.Config) -> bool:
_use_unprivileged_client = py_config.get("use_unprivileged_client")
Expand Down Expand Up @@ -489,8 +502,7 @@ def junitxml_plugin(
return record_testsuite_property if request.config.pluginmanager.has_plugin("junitxml") else None


@pytest.fixture(scope="session", autouse=True)
@pytest.mark.early(order=0)
@pytest.fixture(scope="session")
def cluster_sanity_scope_session(
request: FixtureRequest,
nodes: list[Node],
Expand All @@ -517,3 +529,47 @@ def prometheus(admin_client: DynamicClient) -> Prometheus:
), # TODO: Verify SSL with appropriate certs
bearer_token=get_openshift_token(),
)


@pytest.fixture(scope="session")
def related_images_refs(admin_client: DynamicClient) -> set[str]:
related_images = get_csv_related_images(admin_client=admin_client)
related_images_refs = {img["image"] for img in related_images}
return related_images_refs


@pytest.fixture(scope="session")
def os_path_environment() -> str:
return os.environ["PATH"]


@pytest.fixture(scope="session")
def bin_directory(tmpdir_factory: TempdirFactory) -> LocalPath:
return tmpdir_factory.mktemp(basename="bin")


@pytest.fixture(scope="session")
def bin_directory_to_os_path(os_path_environment: str, bin_directory: LocalPath, oc_binary_path: str) -> None:
LOGGER.info(f"OC binary path: {oc_binary_path}")
LOGGER.info(f"Adding {bin_directory} to $PATH")
os.environ["PATH"] = f"{bin_directory}:{os_path_environment}"


@pytest.fixture(scope="session")
def oc_binary_path(bin_directory: LocalPath) -> str:
installed_oc_binary_path = os.getenv("OC_BINARY_PATH")
if installed_oc_binary_path:
LOGGER.warning(f"Using previously installed: {installed_oc_binary_path}")
return installed_oc_binary_path

return download_oc_console_cli(tmpdir=bin_directory)


@pytest.fixture(scope="session", autouse=True)
@pytest.mark.early(order=0)
def autouse_fixtures(
bin_directory_to_os_path: None,
cluster_sanity_scope_session: None,
) -> None:
"""Fixture to control the order of execution of some of the fixtures"""
return
16 changes: 16 additions & 0 deletions tests/model_explainability/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@

import pytest
from kubernetes.dynamic import DynamicClient
from ocp_resources.config_map import ConfigMap
from ocp_resources.namespace import Namespace
from ocp_resources.persistent_volume_claim import PersistentVolumeClaim
from pytest_testconfig import config as py_config

from tests.model_explainability.trustyai_service.trustyai_service_utils import TRUSTYAI_SERVICE_NAME


@pytest.fixture(scope="class")
Expand All @@ -19,3 +23,15 @@ def pvc_minio_namespace(
size="10Gi",
) as pvc:
yield pvc


@pytest.fixture(scope="session")
def trustyai_operator_configmap(
admin_client: DynamicClient,
) -> ConfigMap:
return ConfigMap(
client=admin_client,
namespace=py_config["applications_namespace"],
name=f"{TRUSTYAI_SERVICE_NAME}-operator-config",
ensure_exists=True,
)
Loading