2022-11-22 08:39:44 +00:00
|
|
|
import os
|
|
|
|
from time import sleep
|
|
|
|
|
|
|
|
import pytest
|
2023-01-12 15:13:52 +00:00
|
|
|
from integrations_app.public import _PATH_EXAMPLES
|
2022-11-22 08:39:44 +00:00
|
|
|
|
2023-02-01 11:07:00 +00:00
|
|
|
from lightning.app.testing.testing import run_app_in_cloud
|
2022-11-22 08:39:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.cloud
|
|
|
|
def test_app_dag_example_cloud() -> None:
|
2022-11-22 19:04:29 +00:00
|
|
|
with run_app_in_cloud(os.path.join(_PATH_EXAMPLES, "app_dag")) as (_, _, fetch_logs, _):
|
2022-11-22 08:39:44 +00:00
|
|
|
|
|
|
|
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)
|