diff --git a/edenai_apis/tests/features/test_async_features.py b/edenai_apis/tests/features/test_async_features.py index 0e09f8e9..b342c026 100644 --- a/edenai_apis/tests/features/test_async_features.py +++ b/edenai_apis/tests/features/test_async_features.py @@ -18,7 +18,8 @@ from edenai_apis.utils.exception import AsyncJobExceptionReason, ProviderException from edenai_apis.utils.types import AsyncBaseResponseType, AsyncLaunchJobResponseType from edenai_apis.utils.compare import compare_responses - +from edenai_apis.interface import IS_MONITORING +from edenai_apis.utils.monitoring import insert_api_call MAX_TIME = 180 TIME_BETWEEN_CHECK = 10 @@ -106,6 +107,9 @@ def _test_api_get_job_result_real_output(self, provider, feature, subfeature): ), "Response shouldn't be empty" assert standardized, "The output is not standardized" + if IS_MONITORING: + insert_api_call(provider, feature, subfeature, None, None) + def _test_async_job(self, provider, feature, subfeature): self._test_launch_job_id(provider, feature, subfeature) self._test_api_get_job_result_real_output(provider, feature, subfeature) diff --git a/edenai_apis/tests/features/test_sync_features.py b/edenai_apis/tests/features/test_sync_features.py index 59401d90..c3c096d8 100644 --- a/edenai_apis/tests/features/test_sync_features.py +++ b/edenai_apis/tests/features/test_sync_features.py @@ -15,9 +15,9 @@ from edenai_apis.utils.constraints import validate_all_provider_constraints from edenai_apis.utils.conversion import iterate_all from edenai_apis.utils.exception import ProviderException -from edenai_apis.utils.files import FileWrapper from edenai_apis.utils.types import ResponseType - +from edenai_apis.interface import IS_MONITORING +from edenai_apis.utils.monitoring import insert_api_call INTERFACE_MODULE = importlib.import_module("edenai_apis.interface_v2") @@ -81,7 +81,10 @@ def _test_feature_api_call(self, provider, feature, subfeature): assert any( [std != None for std in iterate_all(standardized_response, "value")] ), "Response shouldn't be empty" - + + if IS_MONITORING: + insert_api_call(provider, feature, subfeature, None, None) + def _test_feature_saved_output(self, provider, feature, subfeature): # Step 1 (Setup) : saved_output = load_provider( diff --git a/edenai_apis/tests/outputs.py b/edenai_apis/tests/outputs.py index a198565f..c22f2a68 100644 --- a/edenai_apis/tests/outputs.py +++ b/edenai_apis/tests/outputs.py @@ -4,7 +4,6 @@ import time from typing import Callable from edenai_apis.utils.constraints import ( - validate_all_input_languages, validate_all_provider_constraints, ) import pytest @@ -13,6 +12,8 @@ from edenai_apis.loaders.loaders import load_feature, load_provider from edenai_apis.settings import outputs_path, features_path from edenai_apis.utils.types import AsyncLaunchJobResponseType +from edenai_apis.interface import IS_MONITORING +from edenai_apis.utils.monitoring import insert_api_call # TEXT_AUTOML_CLASSIFICATION = ["training_async", "prediction_async"] @@ -123,4 +124,6 @@ def test_outputs(provider, feature, subfeature, phase, generate=True): ) ) + if IS_MONITORING: + insert_api_call(provider=provider,feature=feature,subfeature=subfeature,user_email=None, error=None) return api_output