From a56a67fe873beb80b3ad02d25dec5991285073ce Mon Sep 17 00:00:00 2001 From: Luca Foppiano Date: Mon, 9 Dec 2024 12:56:29 +0000 Subject: [PATCH 1/4] Adjust Github actions --- .github/workflows/ci-build.yml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index d7b5cd5..12d973c 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -9,26 +9,28 @@ concurrency: jobs: build: - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} strategy: matrix: - python-version: [ 3.7, 3.8, 3.9, '3.10', '3.11', '3.12' ] + os: [ubuntu-latest] + python-version: [ 3.9, '3.10', '3.11', '3.12', '3.13' ] node-version: [ 18, 20 ] + fail-fast: false steps: - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - cache: 'pip' - uses: actions/setup-node@v4 with: node-version: ${{matrix.node-version}} - name: build frontend run: | cd streamlit_pdf_viewer/frontend/ + npm --version npm install npm run build + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} - name: Cleanup more disk space run: sudo rm -rf /usr/share/dotnet && sudo rm -rf /opt/ghc && sudo rm -rf "/usr/local/share/boost" && sudo rm -rf "$AGENT_TOOLSDIRECTORY" - name: Install python dependencies @@ -44,6 +46,7 @@ jobs: flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Build Python backend run: | + python --version pip install build python -m build - name: Test with pytest From c4b47ecf006e8e7fbe47dc2cf0a162b24fb2f78b Mon Sep 17 00:00:00 2001 From: Luca Foppiano Date: Sun, 15 Dec 2024 08:52:13 +0100 Subject: [PATCH 2/4] separate dev and prod --- requirements.dev | 6 ++++++ requirements.txt | 3 +-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 requirements.dev diff --git a/requirements.dev b/requirements.dev new file mode 100644 index 0000000..548cafa --- /dev/null +++ b/requirements.dev @@ -0,0 +1,6 @@ +streamlit +bump-my-version +pytest +playwright +pytest-playwright +pytest-cov \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index fd75c4b..e251330 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1 @@ -streamlit -bump-my-version \ No newline at end of file +streamlit \ No newline at end of file From a52276b8eb43ac6de17ea447d99925d44c2a1d56 Mon Sep 17 00:00:00 2001 From: Luca Foppiano Date: Sun, 15 Dec 2024 08:52:58 +0100 Subject: [PATCH 3/4] cleanup --- .github/workflows/ci-build.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 12d973c..d2886d0 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -24,7 +24,6 @@ jobs: - name: build frontend run: | cd streamlit_pdf_viewer/frontend/ - npm --version npm install npm run build - name: Set up Python ${{ matrix.python-version }} @@ -46,7 +45,6 @@ jobs: flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Build Python backend run: | - python --version pip install build python -m build - name: Test with pytest From 6715444ccee224c75f815f5ce9336f98965c3183 Mon Sep 17 00:00:00 2001 From: Luca Foppiano Date: Sun, 15 Dec 2024 08:54:31 +0100 Subject: [PATCH 4/4] wait for the tabs to be visible --- tests/test_rendering_text.py | 2 ++ tests/test_resolution_boost.py | 2 ++ tests/test_tabs.py | 2 ++ tests/test_tabs_2.py | 2 ++ 4 files changed, 8 insertions(+) diff --git a/tests/test_rendering_text.py b/tests/test_rendering_text.py index b1a2273..d9a917f 100644 --- a/tests/test_rendering_text.py +++ b/tests/test_rendering_text.py @@ -31,6 +31,8 @@ def go_to_app(page: Page, streamlit_app: StreamlitRunner): page.goto(streamlit_app.server_url) # Wait for app to load page.get_by_role("img", name="Running...").is_hidden() + page.get_by_text("tab1").wait_for(state="visible") + page.get_by_text("tab2").wait_for(state="visible") def test_should_render_template_check_container_size(page: Page): diff --git a/tests/test_resolution_boost.py b/tests/test_resolution_boost.py index 354f9b6..0a746a1 100644 --- a/tests/test_resolution_boost.py +++ b/tests/test_resolution_boost.py @@ -31,6 +31,8 @@ def go_to_app(page: Page, streamlit_app: StreamlitRunner): page.goto(streamlit_app.server_url) # Wait for app to load page.get_by_role("img", name="Running...").is_hidden() + page.get_by_text("tab 1").wait_for(state="visible") + page.get_by_text("tab 2").wait_for(state="visible") def test_resolution_boost(page: Page): diff --git a/tests/test_tabs.py b/tests/test_tabs.py index 3119f1e..f7c1777 100644 --- a/tests/test_tabs.py +++ b/tests/test_tabs.py @@ -31,6 +31,8 @@ def go_to_app(page: Page, streamlit_app: StreamlitRunner): page.goto(streamlit_app.server_url) # Wait for app to load page.get_by_role("img", name="Running...").is_hidden() + page.get_by_text("tab1").wait_for(state="visible") + page.get_by_text("tab2").wait_for(state="visible") def test_should_render_template_check_container_size(page: Page): diff --git a/tests/test_tabs_2.py b/tests/test_tabs_2.py index f9c1ce9..2d860d9 100644 --- a/tests/test_tabs_2.py +++ b/tests/test_tabs_2.py @@ -31,6 +31,8 @@ def go_to_app(page: Page, streamlit_app: StreamlitRunner): page.goto(streamlit_app.server_url) # Wait for app to load page.get_by_role("img", name="Running...").is_hidden() + page.get_by_text("tab1").wait_for(state="visible") + page.get_by_text("tab2").wait_for(state="visible") def test_should_render_template_check_container_size(page: Page):