Skip to content

Commit

Permalink
disable remote composer test with pytest
Browse files Browse the repository at this point in the history
  • Loading branch information
IIaKyJIuH committed Sep 22, 2023
1 parent c47a411 commit 8b72bb5
Showing 1 changed file with 45 additions and 44 deletions.
89 changes: 45 additions & 44 deletions test/integration/remote/test_remote_composer.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import os
import shutil

import pytest

from fedot.api.main import Fedot
from fedot.core.repository.tasks import TsForecastingParams
from fedot.core.utils import fedot_project_root
from fedot.remote.infrastructure.clients.test_client import TestClient
from fedot.remote.remote_evaluator import RemoteEvaluator, RemoteTaskParams
Expand Down Expand Up @@ -60,47 +62,46 @@ def test_pseudo_remote_composer_classification():

assert predict is not None

# TODO: "No models were found" error as for 22.09.2023 appears. Fix it.
# import os
# from fedot.core.repository.tasks import TsForecastingParams
# def test_pseudo_remote_composer_ts_forecasting():
# connect_params = {}
# exec_params = {
# 'container_input_path': os.path.join(fedot_project_root(), 'test', 'data'),
# 'container_output_path': os.path.join(fedot_project_root(), 'test', 'data', 'remote'),
# 'container_config_path': os.path.join(fedot_project_root(), 'test', 'data', '.'),
# 'container_image': "test",
# 'timeout': 1
# }
#
# remote_task_params = RemoteTaskParams(
# mode='remote',
# dataset_name='short_time_series')
#
# client = TestClient(connect_params, exec_params,
# output_path=os.path.join(fedot_project_root(), 'test', 'data', 'remote'))
#
# evaluator = RemoteEvaluator()
#
# evaluator.init(
# client=client,
# remote_task_params=remote_task_params
# )
#
# composer_params = {
# 'pop_size': 10,
# 'cv_folds': None,
# 'with_tuning': False,
# 'show_progress': False
# }
#
# preset = 'best_quality'
# automl = Fedot(problem='ts_forecasting', timeout=0.2, task_params=TsForecastingParams(forecast_length=1),
# preset=preset, **composer_params)
#
# path = os.path.join(fedot_project_root(), 'test', 'data', 'short_time_series.csv')
#
# automl.fit(path, target='sea_height')
# predict = automl.predict(path)
# shutil.rmtree(os.path.join(fedot_project_root(), 'test', 'data', 'remote', 'fitted_pipeline'))# recursive deleting
# assert predict is not None

@pytest.mark.skip(reason="No models were found error as for 22.09.2023 appears.Fix it.")
def test_pseudo_remote_composer_ts_forecasting():
connect_params = {}
exec_params = {
'container_input_path': os.path.join(fedot_project_root(), 'test', 'data'),
'container_output_path': os.path.join(fedot_project_root(), 'test', 'data', 'remote'),
'container_config_path': os.path.join(fedot_project_root(), 'test', 'data', '.'),
'container_image': "test",
'timeout': 1
}

remote_task_params = RemoteTaskParams(
mode='remote',
dataset_name='short_time_series')

client = TestClient(connect_params, exec_params,
output_path=os.path.join(fedot_project_root(), 'test', 'data', 'remote'))

evaluator = RemoteEvaluator()

evaluator.init(
client=client,
remote_task_params=remote_task_params
)

composer_params = {
'pop_size': 10,
'cv_folds': None,
'with_tuning': False,
'show_progress': False
}

preset = 'best_quality'
automl = Fedot(problem='ts_forecasting', timeout=0.2, task_params=TsForecastingParams(forecast_length=1),
preset=preset, **composer_params)

path = os.path.join(fedot_project_root(), 'test', 'data', 'short_time_series.csv')

automl.fit(path, target='sea_height')
predict = automl.predict(path)
shutil.rmtree(os.path.join(fedot_project_root(), 'test', 'data', 'remote', 'fitted_pipeline')) # recursive deleting
assert predict is not None

0 comments on commit 8b72bb5

Please sign in to comment.