Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[App] Improve app testing #16000

Merged
merged 3 commits into from Dec 20, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/lightning_app/testing/config.py
Expand Up @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions src/lightning_app/testing/testing.py
Expand Up @@ -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):
Expand Down
4 changes: 2 additions & 2 deletions tests/tests_examples_app/public/test_boring_app.py
Expand Up @@ -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,
_,
Expand All @@ -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!")