Skip to content

Commit

Permalink
[ML] Add Team Ownership Markers to Test Classes (#26957)
Browse files Browse the repository at this point in the history
* Add markers to test classes

* add untracked changes
  • Loading branch information
needuv authored Oct 20, 2022
1 parent 5e7092c commit e40e73d
Show file tree
Hide file tree
Showing 140 changed files with 156 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from devtools_testutils import AzureRecordedTestCase, is_live


@pytest.mark.automle2etest
@pytest.mark.automl_test
@pytest.mark.usefixtures("recorded_test")
@pytest.mark.skipif(
condition=not is_live(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from devtools_testutils import AzureRecordedTestCase, is_live


@pytest.mark.automle2etest
@pytest.mark.automl_test
@pytest.mark.usefixtures(
"recorded_test",
"mock_asset_name",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from devtools_testutils import AzureRecordedTestCase, is_live


@pytest.mark.automle2etest
@pytest.mark.automl_test
@pytest.mark.usefixtures("recorded_test")
@pytest.mark.skipif(
condition=not is_live(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from devtools_testutils import AzureRecordedTestCase, is_live


@pytest.mark.automle2etest
@pytest.mark.automl_test
@pytest.mark.usefixtures("recorded_test")
@pytest.mark.skipif(
condition=not is_live() or platform.python_implementation() == "PyPy",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from devtools_testutils import AzureRecordedTestCase, is_live


@pytest.mark.automle2etest
@pytest.mark.automl_test
@pytest.mark.usefixtures("recorded_test")
@pytest.mark.skipif(
condition=not is_live(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from devtools_testutils import AzureRecordedTestCase, is_live


@pytest.mark.automle2etest
@pytest.mark.automl_test
@pytest.mark.usefixtures("recorded_test")
@pytest.mark.skipif(
condition=not is_live(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from devtools_testutils import AzureRecordedTestCase, is_live


@pytest.mark.automle2etest
@pytest.mark.automl_test
@pytest.mark.usefixtures("recorded_test")
@pytest.mark.skipif(
condition=not is_live(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from devtools_testutils import AzureRecordedTestCase, is_live


@pytest.mark.automle2etest
@pytest.mark.automl_test
@pytest.mark.usefixtures("recorded_test")
@pytest.mark.skipif(
condition=not is_live(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from devtools_testutils import AzureRecordedTestCase, is_live


@pytest.mark.automle2etest
@pytest.mark.automl_test
@pytest.mark.usefixtures("recorded_test")
@pytest.mark.skipif(
condition=not is_live(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from devtools_testutils import AzureRecordedTestCase, is_live


@pytest.mark.automle2etest
@pytest.mark.automl_test
@pytest.mark.usefixtures("recorded_test")
@pytest.mark.skipif(
condition=not is_live(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
from azure.ai.ml.sweep import BanditPolicy, Choice, Uniform


@pytest.mark.automl_test
@pytest.mark.unittest
class TestAutoMLImageClassification:
@pytest.mark.parametrize("run_type", ["single", "sweep", "automode"])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
from azure.ai.ml.sweep import BanditPolicy, Choice, Uniform


@pytest.mark.automl_test
@pytest.mark.unittest
class TestAutoMLImageClassificationMultilabel:
@pytest.mark.parametrize("run_type", ["single", "sweep", "automode"])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from azure.ai.ml.sweep import BanditPolicy, Choice, Uniform


@pytest.mark.automl_test
@pytest.mark.unittest
class TestAutoMLImageInstanceSegmentation:
@pytest.mark.parametrize("run_type", ["single", "sweep", "automode"])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from azure.ai.ml.sweep import BanditPolicy, Choice, Uniform


@pytest.mark.automl_test
@pytest.mark.unittest
class TestAutoMLImageObjectDetection:
@pytest.mark.parametrize("run_type", ["single", "sweep", "automode"])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,7 @@ def loaded_image_instance_segmentation_job(
return job


@pytest.mark.automl_test
@pytest.mark.unittest
class TestAutoMLImageSchema:
@pytest.mark.parametrize("run_type", ["single", "sweep", "automode"])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ def _load_automl_job_from_path(
return job


@pytest.mark.automl_test
@pytest.mark.unittest
class TestAutoMLNLPSchema:
@pytest.mark.parametrize("run_type", ["single", "sweep"])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ def loaded_regression_job_auto_fields(mock_machinelearning_client) -> AutoMLJob:
return job


@pytest.mark.automl_test
@pytest.mark.unittest
class TestAutoMLTabularSchema:
def _validate_automl_tabular_job(self, automl_job):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from azure.ai.ml.entities._job.automl.tabular import ClassificationJob


@pytest.mark.automl_test
@pytest.mark.unittest
class TestAutoMLClassification:
def test_classification_task(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from azure.ai.ml.entities._job.automl.tabular import ForecastingJob


@pytest.mark.automl_test
@pytest.mark.unittest
class TestAutoMLForecasting:
def test_forecasting_task(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from azure.ai.ml.entities._job.automl.tabular.forecasting_settings import ForecastingSettings


@pytest.mark.automl_test
@pytest.mark.unittest
class TestForecastingSettings:
@pytest.mark.parametrize(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from azure.ai.ml.entities._job.automl.tabular import RegressionJob


@pytest.mark.automl_test
@pytest.mark.unittest
class TestAutoMLRegression:
def test_regression_task(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from azure.ai.ml.exceptions import ValidationException


@pytest.mark.automl_test
@pytest.mark.parametrize(
"task_name, expected_type",
[(image_classification, ImageClassificationSearchSpace), (image_object_detection, ImageObjectDetectionSearchSpace)],
Expand Down Expand Up @@ -54,6 +55,7 @@ def test_searchspace(task_name, expected_type):
assert len(automl_job.search_space) == 2


@pytest.mark.automl_test
@pytest.mark.parametrize(
"task_name",
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from azure.ai.ml.entities._job.automl.tabular import ColumnTransformer, TabularFeaturizationSettings


@pytest.mark.automl_test
@pytest.mark.unittest
class TestFeaturizationSettings:
def test_to_rest(self) -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from azure.ai.ml.entities._job.automl.tabular import TabularLimitSettings


@pytest.mark.automl_test
@pytest.mark.unittest
class TestLimitSettings:
def test_limit_from_rest(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from azure.ai.ml.entities._job.automl.tabular.regression_job import RegressionJob


@pytest.mark.automl_test
@pytest.mark.unittest
class TestNCrossValidationSettings:
JOBS = [classification, regression, forecasting]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
from azure.ai.ml.sweep import BanditPolicy, Choice, Uniform


@pytest.mark.automl_test
@pytest.mark.unittest
class TestAutoMLTextClassificationJob:
"""Tests for AutoML NLP Text Classification Job."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
from azure.ai.ml.sweep import BanditPolicy, Choice, Uniform


@pytest.mark.automl_test
@pytest.mark.unittest
class TestAutoMLTextClassificationMultilabelJob:
"""Tests for AutoML NLP Text Classification Multilabel Job."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
from azure.ai.ml.sweep import BanditPolicy, Choice, Uniform


@pytest.mark.automl_test
@pytest.mark.unittest
class TestAutoMLTextNerJob:
"""Tests for AutoML NLP Text NER Job."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from azure.ai.ml.entities import CodeConfiguration


@pytest.mark.production_experience_test
@pytest.mark.unittest
class TestCodeConfiguration:
def test_scoring_script_missing_throw(self) -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from azure.ai.ml.entities._job.resource_configuration import ResourceConfiguration


@pytest.mark.production_experience_test
@pytest.mark.unittest
class TestDeploymentSanity:
def test_instantiate_OnlineEndpoint_fail(self) -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from azure.ai.ml.entities import BatchEndpoint, Endpoint, ManagedOnlineDeployment, OnlineEndpoint


@pytest.mark.production_experience_test
@pytest.mark.unittest
class TestOnlineEndpointYAML:
SIMPLE_ENDPOINT_WITH_BLUE_BAD = "tests/test_configs/endpoints/online/online_endpoint_create_aks_bad.yml"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def deployEndpointAndDeployment(client: MLClient, endpoint: BatchEndpoint, deplo
reason="Tests failing in internal automation due to lack of quota. Cannot record or run in live mode."
)
@pytest.mark.usefixtures("recorded_test")
@pytest.mark.production_experience_test
class TestBatchDeployment(AzureRecordedTestCase):
@pytest.mark.e2etest
@pytest.mark.skip(reason="TODO (1546262): Test failing constantly, so disabling it")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@


@pytest.mark.e2etest
@pytest.mark.production_experience_test
class TestBatchEndpoint(AzureRecordedTestCase):
@pytest.mark.skip(
reason="Tests failing in internal automation due to lack of quota. Cannot record or run in live mode."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ def mock_batch_deployment_operations(


@pytest.mark.unittest
@pytest.mark.production_experience_test
class TestBatchDeploymentOperations:
def test_batch_deployment_create(
self,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def load_batch_deployment_entity_from_yaml(path: str, context={}) -> BatchDeploy


@pytest.mark.unittest
@pytest.mark.production_experience_test
class TestBatchDeploymentSchema:
def test_serialize_batch_deployment(self) -> None:
test_path = "./tests/test_configs/deployments/batch/batch_deployment_1.yaml"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ def mock_batch_endpoint_operations(


@pytest.mark.unittest
@pytest.mark.production_experience_test
class TestBatchEndpointOperations:
def test_batch_endpoint_create(
self,
Expand Down
1 change: 1 addition & 0 deletions sdk/ml/azure-ai-ml/tests/code_asset/e2etests/test_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def code_asset_path(tmp_path: Path) -> str:

@pytest.mark.e2etest
@pytest.mark.usefixtures("recorded_test", "mock_code_hash")
@pytest.mark.core_sdk_test
class TestCode(AzureRecordedTestCase):
def test_create_and_get(self, client: MLClient, code_asset_path: str, randstr: Callable[[], str]) -> None:
name = randstr("name")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def mock_code_operation(


@pytest.mark.unittest
@pytest.mark.core_sdk_test
class TestCodeOperations:
def test_create(
self,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def bodiless_matching(test_proxy):
"mock_asset_name",
"enable_environment_id_arm_expansion",
)
@pytest.mark.training_experiences_test
class TestCommandJob(AzureRecordedTestCase):
@pytest.mark.skip(
"Investigate The network connectivity issue encountered for 'Microsoft.MachineLearningServices'; cannot fulfill the request."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@


@pytest.mark.unittest
@pytest.mark.training_experiences_test
class TestCommandJobEntity:
def test_job_name_generator(self):
job1 = generate_job_name()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@


@pytest.mark.unittest
@pytest.mark.training_experiences_test
class TestCommandJob:
def test_deserialize(self):
test_path = "./tests/test_configs/command_job/command_job_test.yml"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ def assert_component_basic_workflow(
"mock_component_hash",
"enable_environment_id_arm_expansion",
)
@pytest.mark.pipeline_test
class TestComponent(AzureRecordedTestCase):
def test_command_component(self, client: MLClient, randstr: Callable[[str], str]) -> None:
expected_dict = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

@pytest.mark.timeout(_COMPONENT_TIMEOUT_SECOND)
@pytest.mark.unittest
@pytest.mark.pipeline_test
class TestAutoMLComponent:
def test_serialize_deserialize_automl_component(self, mock_machinelearning_client: MLClient):
test_path = "./tests/test_configs/components/automl/classification.yaml"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

@pytest.mark.timeout(_COMPONENT_TIMEOUT_SECOND)
@pytest.mark.unittest
@pytest.mark.pipeline_test
class TestCommandComponentEntity:
def test_component_load(self):
# code is specified in yaml, value is respected
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def mock_component_operation(

@pytest.mark.timeout(_COMPONENT_TIMEOUT_SECOND)
@pytest.mark.unittest
@pytest.mark.pipeline_test
class TestComponentOperation:
def test_create(self, mock_component_operation: ComponentOperations) -> None:
component = CommandComponent(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ def load_component_entity_from_rest_json(path) -> Component:

@pytest.mark.timeout(_COMPONENT_TIMEOUT_SECOND)
@pytest.mark.unittest
@pytest.mark.pipeline_test
class TestCommandComponent:
def test_serialize_deserialize_basic(self, mock_machinelearning_client: MLClient):
test_path = "./tests/test_configs/components/helloworld_component.yml"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

@pytest.mark.timeout(_COMPONENT_TIMEOUT_SECOND)
@pytest.mark.unittest
@pytest.mark.pipeline_test
class TestComponentValidate:
def test_component_name_validate(self):
invalid_component_names = [
Expand Down
Loading

0 comments on commit e40e73d

Please sign in to comment.