1515from models_library .settings .celery import CeleryConfig
1616from models_library .settings .rabbit import RabbitConfig
1717from pytest_simcore .helpers .rawdata_fakers import random_project , random_user
18+ from servicelib .resources import CPU_RESOURCE_LIMIT_KEY , MEM_RESOURCE_LIMIT_KEY
1819from simcore_postgres_database .storage_models import projects , users
1920from simcore_sdk .models .pipeline_models import ComputationalPipeline , ComputationalTask
2021from simcore_service_sidecar import config , utils
@@ -378,6 +379,22 @@ async def _create(
378379 },
379380)
380381
382+ PYTHON_ENV_PRINTER = (
383+ "itisfoundation/osparc-python-runner" ,
384+ "1.0.0" ,
385+ {
386+ "a13d197a-bf8c-4e11-8a15-44a9894cbbe8" : {
387+ "next" : [],
388+ "inputs" : {
389+ "input_1" : {
390+ "store" : SIMCORE_S3_ID ,
391+ "path" : "osparc_python_print_env.py" ,
392+ }
393+ },
394+ },
395+ },
396+ )
397+
381398
382399# FIXME: input schema in osparc-python-executor service is wrong
383400PYTHON_RUNNER_FACTORY_STUDY = (
@@ -410,7 +427,9 @@ async def _create(
410427 [
411428 SLEEPERS_STUDY ,
412429 PYTHON_RUNNER_STUDY ,
430+ PYTHON_ENV_PRINTER ,
413431 ],
432+ ids = ["sleepers" , "python-runner-study" , "python-env-printer" ],
414433)
415434async def test_run_services (
416435 loop ,
@@ -452,7 +471,7 @@ async def rabbit_message_handler(message: aio_pika.IncomingMessage):
452471 await cli .run_sidecar (job_id , user_id , pipeline .project_id , node_id )
453472
454473 await asyncio .sleep (15 ) # wait a little bit for logs to come in
455- await _assert_incoming_data_logs (
474+ _sidecar_logs , tasks_logs , _progress_logs = await _assert_incoming_data_logs (
456475 list (pipeline_cfg .keys ()),
457476 incoming_data ,
458477 user_id ,
@@ -466,6 +485,12 @@ async def rabbit_message_handler(message: aio_pika.IncomingMessage):
466485 assert not list (config .SIDECAR_OUTPUT_FOLDER .glob ("**/*" ))
467486 assert not list (config .SIDECAR_LOG_FOLDER .glob ("**/*" ))
468487
488+ # The python env printer should print what he sees in the environment
489+ if pipeline_cfg == PYTHON_ENV_PRINTER [2 ]:
490+ logs = json .dumps (tasks_logs )
491+ assert CPU_RESOURCE_LIMIT_KEY in logs
492+ assert MEM_RESOURCE_LIMIT_KEY in logs
493+
469494
470495def print_module_variables (module ):
471496 print (module .__name__ , ":" )
0 commit comments