Skip to content

Commit a811bea

Browse files
sheltoncyrilpre-commit-ci[bot]dbasunag
authored
Add QG Markers for AI Safety and marker deprecation warning (#1193)
* feat: add smoke and t1 markers * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Debarati Basu-Nag <dbasunag@redhat.com>
1 parent 4628796 commit a811bea

File tree

5 files changed

+32
-8
lines changed

5 files changed

+32
-8
lines changed

pytest.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ markers =
1111

1212
# CI
1313
smoke: Mark tests as smoke tests; very high critical priority tests. Covers core functionality of the product. Aims to ensure that the build is stable enough for further testing.
14-
sanity: Mark tests as sanity tests. Aims to verify that specific functionality is working as expected.
14+
sanity: <<DEPRECATION WARNING: to be superseded by tier1>> Mark tests as sanity tests. Aims to verify that specific functionality is working as expected.
1515
tier1: Mark tests as tier1. High-priority tests.
1616
tier2: Mark tests as tier2. Medium/low-priority positive tests.
1717
tier3: Mark tests as tier3. Negative and destructive tests.

tests/llama_stack/safety/test_trustyai_fms_provider.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
SECURE_SHIELD_ID: str = "secure_shield"
1010

1111

12+
@pytest.mark.tier1
1213
@pytest.mark.parametrize(
1314
"model_namespace, minio_pod, minio_data_connection, "
1415
"orchestrator_config, guardrails_orchestrator, llama_stack_server_config",

tests/model_explainability/guardrails/test_guardrails.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
LOGGER = get_logger(name=__name__)
3939

4040

41+
@pytest.mark.smoke
4142
@pytest.mark.parametrize(
4243
"model_namespace, orchestrator_config, guardrails_orchestrator",
4344
[
@@ -56,7 +57,6 @@
5657
],
5758
indirect=True,
5859
)
59-
@pytest.mark.smoke
6060
def test_validate_guardrails_orchestrator_images(
6161
model_namespace,
6262
orchestrator_config,
@@ -70,6 +70,7 @@ def test_validate_guardrails_orchestrator_images(
7070
validate_tai_component_images(pod=guardrails_orchestrator_pod, tai_operator_configmap=trustyai_operator_configmap)
7171

7272

73+
@pytest.mark.smoke
7374
@pytest.mark.parametrize(
7475
"model_namespace, orchestrator_config, guardrails_gateway_config, guardrails_orchestrator",
7576
[
@@ -115,7 +116,6 @@ def test_validate_guardrails_orchestrator_images(
115116
],
116117
indirect=True,
117118
)
118-
@pytest.mark.smoke
119119
@pytest.mark.rawdeployment
120120
@pytest.mark.usefixtures("patched_dsc_kserve_headed", "guardrails_gateway_config")
121121
class TestGuardrailsOrchestratorWithBuiltInDetectors:
@@ -212,6 +212,7 @@ def test_guardrails_builtin_detectors_negative_detection(
212212
)
213213

214214

215+
@pytest.mark.smoke
215216
@pytest.mark.parametrize(
216217
"model_namespace, orchestrator_config, guardrails_gateway_config,guardrails_orchestrator",
217218
[
@@ -421,6 +422,7 @@ def check_traces():
421422
indirect=True,
422423
)
423424
@pytest.mark.usefixtures("patched_dsc_kserve_headed")
425+
@pytest.mark.tier1
424426
@pytest.mark.rawdeployment
425427
class TestGuardrailsOrchestratorAutoConfig:
426428
"""
@@ -495,6 +497,7 @@ def test_guardrails_autoconfig_negative_detection(
495497
indirect=True,
496498
)
497499
@pytest.mark.usefixtures("patched_dsc_kserve_headed")
500+
@pytest.mark.tier2
498501
@pytest.mark.rawdeployment
499502
class TestGuardrailsOrchestratorAutoConfigWithGateway:
500503
"""

tests/model_explainability/lm_eval/test_lm_eval.py

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,14 @@
2828

2929

3030
@pytest.mark.skip_on_disconnected
31+
@pytest.mark.tier1
3132
@pytest.mark.parametrize(
3233
"model_namespace, lmevaljob_hf",
3334
[
3435
pytest.param(
3536
{"name": "test-lmeval-hf-tier1"},
3637
{"task_list": {"taskNames": TIER1_LMEVAL_TASKS}},
3738
),
38-
pytest.param(
39-
{"name": "test-lmeval-hf-tier2"},
40-
{"task_list": {"taskNames": TIER2_LMEVAL_TASKS}},
41-
),
4239
pytest.param(
4340
{"name": "test-lmeval-hf-custom-task"},
4441
CUSTOM_UNITXT_TASK_DATA,
@@ -58,6 +55,24 @@ def test_lmeval_huggingface_model(admin_client, model_namespace, lmevaljob_hf_po
5855
validate_lmeval_job_pod_and_logs(lmevaljob_pod=lmevaljob_hf_pod)
5956

6057

58+
@pytest.mark.skip_on_disconnected
59+
@pytest.mark.tier2
60+
@pytest.mark.parametrize(
61+
"model_namespace, lmevaljob_hf",
62+
[
63+
pytest.param(
64+
{"name": "test-lmeval-hf-tier2"},
65+
{"task_list": {"taskNames": TIER2_LMEVAL_TASKS}},
66+
),
67+
],
68+
indirect=True,
69+
)
70+
def test_lmeval_huggingface_model_tier2(admin_client, model_namespace, lmevaljob_hf_pod):
71+
"""Tests that verify running common evaluations (and a custom one) on a model pulled directly from HuggingFace.
72+
On each test we run a different evaluation task, limiting it to 0.5% of the questions on each eval."""
73+
validate_lmeval_job_pod_and_logs(lmevaljob_pod=lmevaljob_hf_pod)
74+
75+
6176
@pytest.mark.parametrize(
6277
"model_namespace, lmeval_data_downloader_pod, lmevaljob_local_offline",
6378
[
@@ -80,6 +95,7 @@ def test_lmeval_local_offline_builtin_tasks_flan_arceasy(
8095
validate_lmeval_job_pod_and_logs(lmevaljob_pod=lmevaljob_local_offline_pod)
8196

8297

98+
@pytest.mark.tier1
8399
@pytest.mark.parametrize(
84100
"model_namespace",
85101
[
@@ -95,6 +111,7 @@ def test_lmeval_vllm_emulator(admin_client, model_namespace, lmevaljob_vllm_emul
95111
validate_lmeval_job_pod_and_logs(lmevaljob_pod=lmevaljob_vllm_emulator_pod)
96112

97113

114+
@pytest.mark.tier1
98115
@pytest.mark.parametrize(
99116
"model_namespace, minio_data_connection",
100117
[
@@ -138,6 +155,7 @@ def test_verify_lmeval_pod_images(lmevaljob_s3_offline_pod, trustyai_operator_co
138155
)
139156

140157

158+
@pytest.mark.tier1
141159
@pytest.mark.parametrize(
142160
"model_namespace, oci_registry_pod_with_minio, lmeval_data_downloader_pod, lmevaljob_local_offline_oci",
143161
[

tests/model_explainability/trustyai_service/service/test_trustyai_service.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
from utilities.constants import MinIo
2323

2424

25+
@pytest.mark.tier1
2526
@pytest.mark.parametrize(
2627
"model_namespace",
2728
[
@@ -45,6 +46,7 @@ def test_trustyai_service_with_invalid_db_cert(
4546
)
4647

4748

49+
@pytest.mark.smoke
4850
@pytest.mark.parametrize(
4951
"model_namespace, trustyai_service",
5052
[
@@ -55,7 +57,6 @@ def test_trustyai_service_with_invalid_db_cert(
5557
],
5658
indirect=True,
5759
)
58-
@pytest.mark.smoke
5960
def test_validate_trustyai_service_image(
6061
admin_client,
6162
model_namespace: Namespace,
@@ -72,6 +73,7 @@ def test_validate_trustyai_service_image(
7273
)
7374

7475

76+
@pytest.mark.tier1
7577
@pytest.mark.parametrize(
7678
"model_namespace, minio_pod, minio_data_connection, trustyai_service",
7779
[

0 commit comments

Comments
 (0)