From 401c5317faae41e9cbfcb6f0edf433eacaf28f5b Mon Sep 17 00:00:00 2001 From: Philip Meier Date: Tue, 17 Sep 2024 09:11:24 +0200 Subject: [PATCH 01/15] add test infrastructure --- .github/actions/setup-test-env/action.yml | 64 +++++++++++++ .github/workflows/test.yml | 31 ++++++ .gitignore | 3 + tests/conftest_patch.py | 110 ++++++++++++++++++++++ tests/setup.sh | 9 ++ 5 files changed, 217 insertions(+) create mode 100644 .github/actions/setup-test-env/action.yml create mode 100644 .github/workflows/test.yml create mode 100644 tests/conftest_patch.py create mode 100755 tests/setup.sh diff --git a/.github/actions/setup-test-env/action.yml b/.github/actions/setup-test-env/action.yml new file mode 100644 index 0000000..05605e6 --- /dev/null +++ b/.github/actions/setup-test-env/action.yml @@ -0,0 +1,64 @@ +name: setup-test-env +description: "Setup test environment" + +inputs: + python-version: + default: "3.10" + description: "Python version to test." + +runs: + using: composite + + steps: + - name: Setup miniforge + uses: conda-incubator/setup-miniconda@v3 + with: + miniforge-version: latest + activate-environment: bokeh-fastapi-test + + - name: Display conda info + shell: bash -el {0} + run: conda info + + - name: Checkout repository + uses: actions/checkout@v4 + with: + repository: bokeh/bokeh + path: ./tests + fetch-tags: true + +# - name: Restore conda environment +# id: cache +# uses: actions/cache@v4 +# with: +# path: ${{ env.CONDA }}/envs +# key: +# env-${{ runner.os }}-${{ runner.arch }}-${{ inputs.python-version +# }}|${{ hashFiles('environment-dev.yml', 'pyproject.toml') }} +# restore-keys: | +# env-${{ runner.os }}-${{ runner.arch }}-${{ inputs.python-version }} + + - name: Update conda environment if necessary +# if: steps.cache.outputs.cache-hit != 'true' + shell: bash + run: conda env update --name bokeh-fastapi-test --file ./tests/bokeh/conda/environment-test-${{ inputs.python-version }}.yml + + - name: Install bokeh-fastapi + shell: bash -el {0} + run: pip install . + + - name: Display development environment + shell: bash -el {0} + run: conda list + + - name: Checkout bokeh tests + shell: bash -el {0} + working-directory: ./tests/bokeh + run: | + BOKEH_VERSION=$(conda list --json | jq --raw-output '.[] | select(.name=="bokeh").version') + git checkout "${BOKEH_VERSION}" + + - name: Apply test patches + shell: bash + working-directory: ./tests + run: ./setup.sh diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..e063b55 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,31 @@ +name: test + +on: + pull_request: + +jobs: + detect-usage: + runs-on: ubuntu-latest + defaults: + run: + shell: bash -el {0} + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup environment + uses: ./.github/actions/setup-test-env + + - name: Restore test cache + id: cache + uses: actions/cache@v4 + with: + path: ./.bokeh_fastapi_cache + key: test-${{ runner.os }}-${{ runner.arch }}|${{}}-${{}} + restore-keys: test-${{ runner.os }}-${{ runner.arch }} + + - name: Create test cache + if: steps.cache.outputs.cache-hit != 'true' + working-directory: ./tests/bokeh + run: pytest || true diff --git a/.gitignore b/.gitignore index 6bf9b98..207e207 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,8 @@ src/bokeh_fastapi/_version.py +tests/bokeh +.bokeh_fastapi_cache + # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] diff --git a/tests/conftest_patch.py b/tests/conftest_patch.py new file mode 100644 index 0000000..042f237 --- /dev/null +++ b/tests/conftest_patch.py @@ -0,0 +1,110 @@ +import contextlib +import json +import sys +import unittest.mock +from pathlib import Path + +import bokeh +import pytest +from bokeh.server.tornado import BokehTornado +from bokeh_fastapi import BokehFastAPI + + +def cache_path() -> Path: + folder = Path(__file__).parents[3] / ".bokeh_fastapi_cache" + folder.mkdir(parents=True, exist_ok=True) + name = f"python-{sys.version_info[0]}.{sys.version_info[1]}-bokeh-{bokeh.__version__}.json" + return folder / name + + +TESTS = [] +PATCHES = {} + + +def update_required_patches(modules): + global PATCHES + for module in modules: + if module in PATCHES: + continue + + for name, obj in module.__dict__.items(): + if isinstance(obj, type) and issubclass(obj, BokehTornado): + PATCHES[module.__name__] = name + break + + +class BokehFastAPICompat(BokehFastAPI): + def __init__(self, *args, **kwargs): + kwargs["websocket_origins"] = kwargs.pop("extra_websocket_origins") + kwargs.pop("absolute_url", None) + kwargs.pop("index", None) + kwargs.pop("websocket_max_message_size_bytes", None) + kwargs.pop("extra_patterns", None) + super().__init__(*args, **kwargs) + + def initialize(self, *args, **kwargs): + pass + + def start(self, *args, **kwargs): + pass + + def __call__(self, *args, **kwargs): + pass + + +@pytest.hookimpl(wrapper=True) +def pytest_collection_modifyitems(config, items): + path = cache_path() + if path.exists(): + with open(cache_path()) as file: + cache = json.load(file) + + tests = set(cache["tests"]) + select = [] + deselect = [] + for item in items: + (select if item.nodeid in tests else deselect).append(item) + items[:] = select + config.hook.pytest_deselected(items=deselect) + + for module_name, obj_name in cache["patches"].items(): + unittest.mock.patch( + f"{module_name}.{obj_name}", new=BokehFastAPICompat + ).start() + else: + update_required_patches({item.module for item in items}) + + return (yield) + + +def pytest_terminal_summary(): + path = cache_path() + if not path.exists(): + with open(path, "w") as file: + json.dump({"patches": PATCHES, "tests": TESTS}, file, indent=2) + + +@pytest.fixture(autouse=True) +def detect_bokeh_tornado_usage(request): + update_required_patches( + [ + module + for name, module in sys.modules.items() + if (name == "bokeh" or name.startswith("bokeh.")) + and name != "bokeh.server.tornado" + ] + ) + + with contextlib.ExitStack() as stack: + spies = [ + stack.enter_context( + unittest.mock.patch(f"{module_name}.{obj_name}", wraps=BokehTornado) + ) + for module_name, obj_name in PATCHES.items() + ] + + yield + + global TESTS + if any(spy.called for spy in spies): + TESTS.append(request.node.nodeid) diff --git a/tests/setup.sh b/tests/setup.sh new file mode 100755 index 0000000..5170e37 --- /dev/null +++ b/tests/setup.sh @@ -0,0 +1,9 @@ +TESTS_DIR='./bokeh/tests' +CONFTEST="${TESTS_DIR}/conftest.py" +BACKUP="${TESTS_DIR}/conftest.py.bak" + +if [[ ! -f "${BACKUP}" ]]; then + cp "${CONFTEST}" "${BACKUP}" +fi + +cat "${BACKUP}" './conftest_patch.py' > "${CONFTEST}" From e25ff43a18be457e2fedca2c8324d1e19e454c82 Mon Sep 17 00:00:00 2001 From: Philip Meier Date: Tue, 17 Sep 2024 09:17:09 +0200 Subject: [PATCH 02/15] add outputs --- .github/actions/setup-test-env/action.yml | 10 ++++++++++ .github/workflows/test.yml | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/actions/setup-test-env/action.yml b/.github/actions/setup-test-env/action.yml index 05605e6..68f8476 100644 --- a/.github/actions/setup-test-env/action.yml +++ b/.github/actions/setup-test-env/action.yml @@ -6,6 +6,14 @@ inputs: default: "3.10" description: "Python version to test." +outputs: + python-version: + description: "Installed Python version." + value: ${{ inputs.python-version }} + bokeh-version: + description: "Installed bokeh version." + value: ${{ steps.tests.outputs.bokeh-version }} + runs: using: composite @@ -52,10 +60,12 @@ runs: run: conda list - name: Checkout bokeh tests + id: tests shell: bash -el {0} working-directory: ./tests/bokeh run: | BOKEH_VERSION=$(conda list --json | jq --raw-output '.[] | select(.name=="bokeh").version') + echo "bokeh-version=${BOKEH_VERSION}" | tee --append "${GITHUB_OUTPUT}" git checkout "${BOKEH_VERSION}" - name: Apply test patches diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e063b55..3d4df1a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,6 +15,7 @@ jobs: uses: actions/checkout@v4 - name: Setup environment + id: setup uses: ./.github/actions/setup-test-env - name: Restore test cache @@ -22,7 +23,7 @@ jobs: uses: actions/cache@v4 with: path: ./.bokeh_fastapi_cache - key: test-${{ runner.os }}-${{ runner.arch }}|${{}}-${{}} + key: test-${{ runner.os }}-${{ runner.arch }}|${{ steps.setup.outputs.python-version }}-${{ steps.setup.outputs.bokeh-version }} restore-keys: test-${{ runner.os }}-${{ runner.arch }} - name: Create test cache From 9e537315305a31572fb8808bde21a9790a613b65 Mon Sep 17 00:00:00 2001 From: Philip Meier Date: Tue, 17 Sep 2024 09:21:16 +0200 Subject: [PATCH 03/15] debug --- .github/actions/setup-test-env/action.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/actions/setup-test-env/action.yml b/.github/actions/setup-test-env/action.yml index 68f8476..0e32653 100644 --- a/.github/actions/setup-test-env/action.yml +++ b/.github/actions/setup-test-env/action.yml @@ -35,6 +35,16 @@ runs: path: ./tests fetch-tags: true + - name: Debug + shell: bash + run: | + ls -la . + echo '##################' + ls -la ./tests + echo '##################' + ls -la ./tests/bokeh + echo '##################' + # - name: Restore conda environment # id: cache # uses: actions/cache@v4 From 74fdb368e568262ef2761969049ce20aea12bb15 Mon Sep 17 00:00:00 2001 From: Philip Meier Date: Tue, 17 Sep 2024 09:22:36 +0200 Subject: [PATCH 04/15] fix checkout path --- .github/actions/setup-test-env/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup-test-env/action.yml b/.github/actions/setup-test-env/action.yml index 0e32653..00b6626 100644 --- a/.github/actions/setup-test-env/action.yml +++ b/.github/actions/setup-test-env/action.yml @@ -32,7 +32,7 @@ runs: uses: actions/checkout@v4 with: repository: bokeh/bokeh - path: ./tests + path: ./tests/bokeh fetch-tags: true - name: Debug From 50e717d6f227395ab7c2848b0952e44876a5f2b9 Mon Sep 17 00:00:00 2001 From: Philip Meier Date: Tue, 17 Sep 2024 09:27:08 +0200 Subject: [PATCH 05/15] rearrange --- .github/actions/setup-test-env/action.yml | 35 +++++++---------------- 1 file changed, 10 insertions(+), 25 deletions(-) diff --git a/.github/actions/setup-test-env/action.yml b/.github/actions/setup-test-env/action.yml index 00b6626..cd36ec7 100644 --- a/.github/actions/setup-test-env/action.yml +++ b/.github/actions/setup-test-env/action.yml @@ -12,7 +12,7 @@ outputs: value: ${{ inputs.python-version }} bokeh-version: description: "Installed bokeh version." - value: ${{ steps.tests.outputs.bokeh-version }} + value: ${{ steps.install.outputs.bokeh-version }} runs: using: composite @@ -28,22 +28,20 @@ runs: shell: bash -el {0} run: conda info + - name: Install bokeh-fastapi + id: install + shell: bash -el {0} + run: | + pip install . + BOKEH_VERSION=$(conda list --json | jq --raw-output '.[] | select(.name=="bokeh").version') + echo "bokeh-version=${BOKEH_VERSION}" | tee --append "${GITHUB_OUTPUT}" + - name: Checkout repository uses: actions/checkout@v4 with: repository: bokeh/bokeh path: ./tests/bokeh - fetch-tags: true - - - name: Debug - shell: bash - run: | - ls -la . - echo '##################' - ls -la ./tests - echo '##################' - ls -la ./tests/bokeh - echo '##################' + ref: ${{ steps.install.outputs.bokeh-version }} # - name: Restore conda environment # id: cache @@ -61,23 +59,10 @@ runs: shell: bash run: conda env update --name bokeh-fastapi-test --file ./tests/bokeh/conda/environment-test-${{ inputs.python-version }}.yml - - name: Install bokeh-fastapi - shell: bash -el {0} - run: pip install . - - name: Display development environment shell: bash -el {0} run: conda list - - name: Checkout bokeh tests - id: tests - shell: bash -el {0} - working-directory: ./tests/bokeh - run: | - BOKEH_VERSION=$(conda list --json | jq --raw-output '.[] | select(.name=="bokeh").version') - echo "bokeh-version=${BOKEH_VERSION}" | tee --append "${GITHUB_OUTPUT}" - git checkout "${BOKEH_VERSION}" - - name: Apply test patches shell: bash working-directory: ./tests From 1abff366088a57c2efa869775f7252c928815462 Mon Sep 17 00:00:00 2001 From: Philip Meier Date: Tue, 17 Sep 2024 09:34:37 +0200 Subject: [PATCH 06/15] try fix --- .github/actions/setup-test-env/action.yml | 32 +++++++++++++---------- .github/workflows/test.yml | 2 ++ pyproject.toml | 2 +- 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/.github/actions/setup-test-env/action.yml b/.github/actions/setup-test-env/action.yml index cd36ec7..247aab9 100644 --- a/.github/actions/setup-test-env/action.yml +++ b/.github/actions/setup-test-env/action.yml @@ -24,14 +24,15 @@ runs: miniforge-version: latest activate-environment: bokeh-fastapi-test - - name: Display conda info - shell: bash -el {0} - run: conda info + - shell: bash -el {0} + run: | + # Display conda info + conda info - - name: Install bokeh-fastapi - id: install + - id: install shell: bash -el {0} run: | + # Install bokeh-fastapi pip install . BOKEH_VERSION=$(conda list --json | jq --raw-output '.[] | select(.name=="bokeh").version') echo "bokeh-version=${BOKEH_VERSION}" | tee --append "${GITHUB_OUTPUT}" @@ -54,16 +55,19 @@ runs: # restore-keys: | # env-${{ runner.os }}-${{ runner.arch }}-${{ inputs.python-version }} - - name: Update conda environment if necessary -# if: steps.cache.outputs.cache-hit != 'true' + - # if: steps.cache.outputs.cache-hit != 'true' shell: bash - run: conda env update --name bokeh-fastapi-test --file ./tests/bokeh/conda/environment-test-${{ inputs.python-version }}.yml + run: | + # Update conda environment if necessary + conda env update --name bokeh-fastapi-test --file ./tests/bokeh/conda/environment-test-${{ inputs.python-version }}.yml - - name: Display development environment - shell: bash -el {0} - run: conda list + - shell: bash -el {0} + run: | + # Display test environment + conda list - - name: Apply test patches - shell: bash + - shell: bash working-directory: ./tests - run: ./setup.sh + run: | + # Apply test patches + ./setup.sh diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3d4df1a..5f626d4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,6 +13,8 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Setup environment id: setup diff --git a/pyproject.toml b/pyproject.toml index 224f75b..6e15e33 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ requires = [ build-backend = "setuptools.build_meta" [project] -name = "bokeh_fastapi" +name = "bokeh-fastapi" description = "Compatibility layer between Bokeh and FastAPI" readme = "README.md" authors = [ From 15d7fd0ab6e165c4ddb20b6c2b59cc95d7b2779e Mon Sep 17 00:00:00 2001 From: Philip Meier Date: Tue, 17 Sep 2024 09:38:10 +0200 Subject: [PATCH 07/15] debug --- .github/actions/setup-test-env/action.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/actions/setup-test-env/action.yml b/.github/actions/setup-test-env/action.yml index 247aab9..ba81546 100644 --- a/.github/actions/setup-test-env/action.yml +++ b/.github/actions/setup-test-env/action.yml @@ -33,6 +33,11 @@ runs: shell: bash -el {0} run: | # Install bokeh-fastapi + ls -la . + echo '#########' + cat pyproject.toml + echo '#########' + exit 1 pip install . BOKEH_VERSION=$(conda list --json | jq --raw-output '.[] | select(.name=="bokeh").version') echo "bokeh-version=${BOKEH_VERSION}" | tee --append "${GITHUB_OUTPUT}" From 2846a522fed1fd6df9c67e956642cf4ab80835cd Mon Sep 17 00:00:00 2001 From: Philip Meier Date: Tue, 17 Sep 2024 09:41:03 +0200 Subject: [PATCH 08/15] mroe debug --- .github/actions/setup-test-env/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup-test-env/action.yml b/.github/actions/setup-test-env/action.yml index ba81546..63b109c 100644 --- a/.github/actions/setup-test-env/action.yml +++ b/.github/actions/setup-test-env/action.yml @@ -37,8 +37,8 @@ runs: echo '#########' cat pyproject.toml echo '#########' - exit 1 pip install . + exit 1 BOKEH_VERSION=$(conda list --json | jq --raw-output '.[] | select(.name=="bokeh").version') echo "bokeh-version=${BOKEH_VERSION}" | tee --append "${GITHUB_OUTPUT}" From 2ee454af1583d3ca7e87f4b176ea3554f1139faa Mon Sep 17 00:00:00 2001 From: Philip Meier Date: Tue, 17 Sep 2024 09:45:23 +0200 Subject: [PATCH 09/15] install pip into conda env --- .github/actions/setup-test-env/action.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/actions/setup-test-env/action.yml b/.github/actions/setup-test-env/action.yml index 63b109c..dc0066c 100644 --- a/.github/actions/setup-test-env/action.yml +++ b/.github/actions/setup-test-env/action.yml @@ -33,9 +33,15 @@ runs: shell: bash -el {0} run: | # Install bokeh-fastapi - ls -la . + which pip echo '#########' - cat pyproject.toml + pip -V + echo '#########' + conda install pip + echo '#########' + which pip + echo '#########' + pip -V echo '#########' pip install . exit 1 From 6cf13d1bde3094b53f5fa8256859524271b51720 Mon Sep 17 00:00:00 2001 From: Philip Meier Date: Tue, 17 Sep 2024 09:49:12 +0200 Subject: [PATCH 10/15] more --- .github/actions/setup-test-env/action.yml | 32 ++++++++--------------- 1 file changed, 11 insertions(+), 21 deletions(-) diff --git a/.github/actions/setup-test-env/action.yml b/.github/actions/setup-test-env/action.yml index dc0066c..3014128 100644 --- a/.github/actions/setup-test-env/action.yml +++ b/.github/actions/setup-test-env/action.yml @@ -29,22 +29,23 @@ runs: # Display conda info conda info + # - name: Restore conda environment +# id: cache +# uses: actions/cache@v4 +# with: +# path: ${{ env.CONDA }}/envs +# key: +# env-${{ runner.os }}-${{ runner.arch }}-${{ inputs.python-version +# }}|${{ hashFiles('environment-dev.yml', 'pyproject.toml') }} +# restore-keys: | +# env-${{ runner.os }}-${{ runner.arch }}-${{ inputs.python-version }} + - id: install shell: bash -el {0} run: | # Install bokeh-fastapi - which pip - echo '#########' - pip -V - echo '#########' conda install pip - echo '#########' - which pip - echo '#########' - pip -V - echo '#########' pip install . - exit 1 BOKEH_VERSION=$(conda list --json | jq --raw-output '.[] | select(.name=="bokeh").version') echo "bokeh-version=${BOKEH_VERSION}" | tee --append "${GITHUB_OUTPUT}" @@ -55,17 +56,6 @@ runs: path: ./tests/bokeh ref: ${{ steps.install.outputs.bokeh-version }} -# - name: Restore conda environment -# id: cache -# uses: actions/cache@v4 -# with: -# path: ${{ env.CONDA }}/envs -# key: -# env-${{ runner.os }}-${{ runner.arch }}-${{ inputs.python-version -# }}|${{ hashFiles('environment-dev.yml', 'pyproject.toml') }} -# restore-keys: | -# env-${{ runner.os }}-${{ runner.arch }}-${{ inputs.python-version }} - - # if: steps.cache.outputs.cache-hit != 'true' shell: bash run: | From 49119b39a129cc5bc87d8b5551c91adaf76a0e31 Mon Sep 17 00:00:00 2001 From: Philip Meier Date: Tue, 17 Sep 2024 09:59:00 +0200 Subject: [PATCH 11/15] set python version --- .github/actions/setup-test-env/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/setup-test-env/action.yml b/.github/actions/setup-test-env/action.yml index 3014128..0680feb 100644 --- a/.github/actions/setup-test-env/action.yml +++ b/.github/actions/setup-test-env/action.yml @@ -23,6 +23,7 @@ runs: with: miniforge-version: latest activate-environment: bokeh-fastapi-test + python-version: ${{ inputs.python-version }} - shell: bash -el {0} run: | From e75fd323bb45a6262a759b42a4400dd409848778 Mon Sep 17 00:00:00 2001 From: Philip Meier Date: Tue, 17 Sep 2024 10:02:21 +0200 Subject: [PATCH 12/15] only run unit tests --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5f626d4..8693299 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,4 +31,4 @@ jobs: - name: Create test cache if: steps.cache.outputs.cache-hit != 'true' working-directory: ./tests/bokeh - run: pytest || true + run: pytest tests/unit || true From e27268ddd3ec5dba337a39185f75ab92eb966ed6 Mon Sep 17 00:00:00 2001 From: Philip Meier Date: Tue, 17 Sep 2024 10:10:32 +0200 Subject: [PATCH 13/15] run tests --- .github/workflows/test.yml | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8693299..b440660 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,8 +13,6 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 - with: - fetch-depth: 0 - name: Setup environment id: setup @@ -32,3 +30,31 @@ jobs: if: steps.cache.outputs.cache-hit != 'true' working-directory: ./tests/bokeh run: pytest tests/unit || true + run: + needs: + - detect-usage + + runs-on: ubuntu-latest + defaults: + run: + shell: bash -el {0} + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup environment + id: setup + uses: ./.github/actions/setup-test-env + + - name: Restore test cache + id: cache + uses: actions/cache@v4 + with: + path: ./.bokeh_fastapi_cache + key: test-${{ runner.os }}-${{ runner.arch }}|${{ steps.setup.outputs.python-version }}-${{ steps.setup.outputs.bokeh-version }} + restore-keys: test-${{ runner.os }}-${{ runner.arch }} + + - name: Run tests + working-directory: ./tests/bokeh + run: pytest From 717db086a5fbd38eec04db81637dd31a8bd2b14a Mon Sep 17 00:00:00 2001 From: Philip Meier Date: Tue, 17 Sep 2024 10:27:30 +0200 Subject: [PATCH 14/15] temp remove compat --- tests/conftest_patch.py | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/tests/conftest_patch.py b/tests/conftest_patch.py index 042f237..db30f05 100644 --- a/tests/conftest_patch.py +++ b/tests/conftest_patch.py @@ -34,22 +34,23 @@ def update_required_patches(modules): class BokehFastAPICompat(BokehFastAPI): - def __init__(self, *args, **kwargs): - kwargs["websocket_origins"] = kwargs.pop("extra_websocket_origins") - kwargs.pop("absolute_url", None) - kwargs.pop("index", None) - kwargs.pop("websocket_max_message_size_bytes", None) - kwargs.pop("extra_patterns", None) - super().__init__(*args, **kwargs) - - def initialize(self, *args, **kwargs): - pass - - def start(self, *args, **kwargs): - pass - - def __call__(self, *args, **kwargs): - pass + pass + # def __init__(self, *args, **kwargs): + # kwargs["websocket_origins"] = kwargs.pop("extra_websocket_origins") + # kwargs.pop("absolute_url", None) + # kwargs.pop("index", None) + # kwargs.pop("websocket_max_message_size_bytes", None) + # kwargs.pop("extra_patterns", None) + # super().__init__(*args, **kwargs) + # + # def initialize(self, *args, **kwargs): + # pass + # + # def start(self, *args, **kwargs): + # pass + # + # def __call__(self, *args, **kwargs): + # pass @pytest.hookimpl(wrapper=True) From 82dadecd9e34734cd0197b4b5bf992adc592d81f Mon Sep 17 00:00:00 2001 From: Philip Meier Date: Tue, 17 Sep 2024 10:51:18 +0200 Subject: [PATCH 15/15] decrease verbosity --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b440660..70c1d5d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,7 +29,7 @@ jobs: - name: Create test cache if: steps.cache.outputs.cache-hit != 'true' working-directory: ./tests/bokeh - run: pytest tests/unit || true + run: pytest --no-header --no-summary --quiet --tb=no tests/unit || true run: needs: - detect-usage @@ -57,4 +57,4 @@ jobs: - name: Run tests working-directory: ./tests/bokeh - run: pytest + run: pytest --tb=short