From eef98c8fc6a1b86c242c869eb637019c50c638cd Mon Sep 17 00:00:00 2001 From: thomas chaton Date: Tue, 20 Dec 2022 06:31:22 +0100 Subject: [PATCH] [App] update app testing (#16000) Co-authored-by: thomas --- src/lightning_app/testing/config.py | 2 +- src/lightning_app/testing/testing.py | 4 ++-- tests/tests_examples_app/public/test_boring_app.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lightning_app/testing/config.py b/src/lightning_app/testing/config.py index e18ec0ebe75bdb..2376e7032cd222 100644 --- a/src/lightning_app/testing/config.py +++ b/src/lightning_app/testing/config.py @@ -6,7 +6,7 @@ class _Config: id = os.getenv("LIGHTNING_USER_ID") key = os.getenv("LIGHTNING_API_KEY") - url = os.getenv("LIGHTNING_CLOUD_URL", "") + url = os.getenv("LIGHTNING_CLOUD_URL", "https://lightning.ai") api_key = os.getenv("LIGHTNING_API_KEY") username = os.getenv("LIGHTNING_USERNAME") video_location = os.getenv("VIDEO_LOCATION", "./artifacts/videos") diff --git a/src/lightning_app/testing/testing.py b/src/lightning_app/testing/testing.py index 40b705458dd491..0c73f79b598228 100644 --- a/src/lightning_app/testing/testing.py +++ b/src/lightning_app/testing/testing.py @@ -488,12 +488,12 @@ def wait_for(page, callback: Callable, *args, **kwargs) -> Any: except (playwright._impl._api_types.Error, playwright._impl._api_types.TimeoutError) as e: print(e) try: - sleep(5) + sleep(7) page.reload() except (playwright._impl._api_types.Error, playwright._impl._api_types.TimeoutError) as e: print(e) pass - sleep(2) + sleep(3) def _delete_lightning_app(client, project_id, app_id, app_name): diff --git a/tests/tests_examples_app/public/test_boring_app.py b/tests/tests_examples_app/public/test_boring_app.py index a97bccb93229b9..80be34745a1de8 100644 --- a/tests/tests_examples_app/public/test_boring_app.py +++ b/tests/tests_examples_app/public/test_boring_app.py @@ -10,7 +10,7 @@ @pytest.mark.cloud def test_boring_app_example_cloud() -> None: - with run_app_in_cloud(os.path.join(_PATH_EXAMPLES, "app_boring"), app_name="app_dynamic.py", debug=True,) as ( + with run_app_in_cloud(os.path.join(_PATH_EXAMPLES, "app_boring"), app_name="app_dynamic.py", debug=True) as ( _, view_page, _, @@ -30,5 +30,5 @@ def check_hello_there(*_, **__): assert result.exit_code == 0 assert result.exception is None - assert any("--filepath=/content/.storage/boring_file.txt" in line for line in lines) + assert any("Received from root.dict.dst_w" in line for line in lines) print("Succeeded App!")