From b0bd949d5806b4f5814485cfc35bd00018a25f9d Mon Sep 17 00:00:00 2001 From: Mansy Date: Tue, 27 Sep 2022 09:16:46 +0200 Subject: [PATCH] Enable quick-start-app-e2e (#14542) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Akihiro Nitta Co-authored-by: Adrian Wälchli --- .azure/app-cloud-e2e.yml | 26 ++++++++++++++------ requirements/app/test.txt | 1 + src/lightning_app/testing/testing.py | 1 + tests/tests_app_examples/test_quick_start.py | 2 +- 4 files changed, 21 insertions(+), 9 deletions(-) diff --git a/.azure/app-cloud-e2e.yml b/.azure/app-cloud-e2e.yml index 1c6822cf2b..88c15e57fb 100644 --- a/.azure/app-cloud-e2e.yml +++ b/.azure/app-cloud-e2e.yml @@ -43,7 +43,7 @@ jobs: pool: azure-cpus container: image: mcr.microsoft.com/playwright/python:v1.25.2-focal - options: "--shm-size=2g" + options: "--shm-size=4gb" strategy: matrix: 'App: v0_app': @@ -68,6 +68,8 @@ jobs: name: "payload" 'App: commands_and_api': name: "commands_and_api" + 'App: quick_start': + name: "quick_start" timeoutInMinutes: "30" cancelTimeoutInMinutes: "2" # values: https://docs.microsoft.com/en-us/azure/devops/pipelines/process/phases?view=azure-devops&tabs=yaml#workspace @@ -87,6 +89,7 @@ jobs: displayName: 'Info' - task: Cache@2 + condition: ne(variables['name'], 'quick_start') inputs: key: 'pip | "$(name)" | requirements/app/base.txt' restoreKeys: | @@ -94,9 +97,10 @@ jobs: path: $(pip_cache_dir) displayName: Cache pip - - bash: python -m pip install -r requirements/app/devel.txt --quiet --find-links ${TORCH_URL} - env: - TORCH_URL: https://download.pytorch.org/whl/cpu/torch_stable.html + - bash: python -m pip install -e . --find-links https://download.pytorch.org/whl/cpu/torch_stable.html + displayName: 'Install lightning' + + - bash: python -m pip install -r requirements/app/test.txt -r requirements/app/ui.txt displayName: 'Install dependencies' - bash: | @@ -104,9 +108,6 @@ jobs: python -m playwright install # --with-deps displayName: 'Install Playwright system dependencies' - - bash: pip install -e . --find-links https://download.pytorch.org/whl/cpu/torch_stable.html - displayName: 'Install lightning' - - bash: | rm -rf examples/app_template_jupyterlab || true git clone https://github.com/Lightning-AI/LAI-lightning-template-jupyterlab-App examples/app_template_jupyterlab @@ -120,11 +121,20 @@ jobs: condition: eq(variables['name'], 'template_react_ui') displayName: 'Clone Template React UI Repo' + - bash: python -m lightning install app lightning/quick-start -y + condition: eq(variables['name'], 'quick_start') + displayName: 'Install Quick Start' + + - bash: | + pip --version + pip list + displayName: 'List pip dependency' + - bash: | mkdir -p ${VIDEO_LOCATION} ls -l examples/${TEST_APP_NAME} ls -l tests/tests_app_examples - python -m pytest tests/tests_app_examples/test_${TEST_APP_NAME}.py::test_${TEST_APP_NAME}_example_cloud --timeout=900 --capture=no -v --color=yes + python -m pytest tests/tests_app_examples/test_${TEST_APP_NAME}.py::test_${TEST_APP_NAME}_example_cloud --timeout=1200 --capture=no -v --color=yes env: HEADLESS: '1' PACKAGE_LIGHTNING: '1' diff --git a/requirements/app/test.txt b/requirements/app/test.txt index c6a2a61b2c..bb7b604512 100644 --- a/requirements/app/test.txt +++ b/requirements/app/test.txt @@ -9,3 +9,4 @@ httpx trio pympler psutil +setuptools<=59.5.0 diff --git a/src/lightning_app/testing/testing.py b/src/lightning_app/testing/testing.py index 430c786625..0b7078622a 100644 --- a/src/lightning_app/testing/testing.py +++ b/src/lightning_app/testing/testing.py @@ -420,6 +420,7 @@ def run_app_in_cloud( context.close() browser.close() + Popen("lightning disconnect", shell=True).wait() def wait_for(page, callback: Callable, *args, **kwargs) -> Any: diff --git a/tests/tests_app_examples/test_quick_start.py b/tests/tests_app_examples/test_quick_start.py index 454c1084ca..875d501bc3 100644 --- a/tests/tests_app_examples/test_quick_start.py +++ b/tests/tests_app_examples/test_quick_start.py @@ -55,7 +55,7 @@ def test_quick_start_example_cloud() -> None: def click_gradio_demo(*_, **__): button = view_page.locator('button:has-text("Interactive demo")') - button.wait_for(timeout=3 * 1000) + button.wait_for(timeout=5 * 1000) button.click() return True