lightning/tests/tests_examples_app/public/test_app_dag.py

22 lines
666 B
Python

import os
from time import sleep
import pytest
from tests_examples_app.public import _PATH_EXAMPLES
from lightning_app.testing.testing import run_app_in_cloud
@pytest.mark.cloud
def test_app_dag_example_cloud() -> None:
with run_app_in_cloud(os.path.join(_PATH_EXAMPLES, "app_dag")) as (_, _, fetch_logs, _):
launch_log, finish_log = False, False
while not (launch_log and finish_log):
for log in fetch_logs(["flow"]):
if "Launching a new DAG" in log:
launch_log = True
elif "Finished training and evaluating" in log:
finish_log = True
sleep(1)