|
20 | 20 | dcc_paths_changed: ${{ steps.filter.outputs.dcc_related_paths }} |
21 | 21 | html_paths_changed: ${{ steps.filter.outputs.html_related_paths }} |
22 | 22 | websocket_changed: ${{ steps.filter.outputs.websocket_paths }} |
| 23 | + streaming_changed: ${{ steps.filter.outputs.streaming_paths }} |
23 | 24 | steps: |
24 | 25 | - name: Checkout repository |
25 | 26 | uses: actions/checkout@v4 |
|
79 | 80 | - '@dash-websocket-worker/**' |
80 | 81 | - 'dash/dash-renderer/src/**' |
81 | 82 | - 'tests/websocket/**' |
| 83 | + streaming_paths: |
| 84 | + - *shared_paths |
| 85 | + - 'dash/_callback.py' |
| 86 | + - 'dash/_streaming.py' |
| 87 | + - 'dash/_callback_context.py' |
| 88 | + - 'dash/backends/**' |
| 89 | + - 'dash/dash-renderer/src/**' |
| 90 | + - 'tests/streaming/**' |
82 | 91 |
|
83 | 92 | lint-unit: |
84 | 93 | name: Lint & Unit Tests (Python ${{ matrix.python-version }}) |
@@ -256,6 +265,77 @@ jobs: |
256 | 265 | tests/compliance/test_typing.py \ |
257 | 266 | tests/compliance/test_callback_typing.py |
258 | 267 |
|
| 268 | + shared-storage: |
| 269 | + name: Run Shared Storage Tests (Python ${{ matrix.python-version }}) |
| 270 | + needs: build |
| 271 | + timeout-minutes: 20 |
| 272 | + runs-on: ubuntu-latest |
| 273 | + strategy: |
| 274 | + fail-fast: false |
| 275 | + matrix: |
| 276 | + python-version: ["3.9", "3.12"] |
| 277 | + |
| 278 | + # Redis service for the RedisSharedStorage backend. |
| 279 | + services: |
| 280 | + redis: |
| 281 | + image: redis:6 |
| 282 | + ports: |
| 283 | + - 6379:6379 |
| 284 | + options: >- |
| 285 | + --health-cmd "redis-cli ping" |
| 286 | + --health-interval 10s |
| 287 | + --health-timeout 5s |
| 288 | + --health-retries 5 |
| 289 | +
|
| 290 | + env: |
| 291 | + REDIS_URL: redis://localhost:6379 |
| 292 | + |
| 293 | + steps: |
| 294 | + - name: Checkout repository |
| 295 | + uses: actions/checkout@v4 |
| 296 | + |
| 297 | + - name: Set up Node.js |
| 298 | + uses: actions/setup-node@v4 |
| 299 | + with: |
| 300 | + node-version: '24' |
| 301 | + cache: 'npm' |
| 302 | + |
| 303 | + - name: Install Node.js dependencies |
| 304 | + run: npm ci |
| 305 | + |
| 306 | + - name: Set up Python ${{ matrix.python-version }} |
| 307 | + uses: actions/setup-python@v5 |
| 308 | + with: |
| 309 | + python-version: ${{ matrix.python-version }} |
| 310 | + cache: 'pip' |
| 311 | + cache-dependency-path: requirements/*.txt |
| 312 | + |
| 313 | + - name: Download built Dash packages |
| 314 | + uses: actions/download-artifact@v4 |
| 315 | + with: |
| 316 | + name: dash-packages |
| 317 | + path: packages/ |
| 318 | + |
| 319 | + - name: Install Dash packages |
| 320 | + run: | |
| 321 | + python -m pip install --upgrade pip wheel |
| 322 | + python -m pip install "setuptools<80.0.0" |
| 323 | + find packages -name dash-*.whl -print -exec sh -c 'pip install "{}[ci,testing,dev,diskcache,redis]"' \; |
| 324 | +
|
| 325 | + - name: Setup Chrome and ChromeDriver |
| 326 | + uses: browser-actions/setup-chrome@v1 |
| 327 | + with: |
| 328 | + chrome-version: stable |
| 329 | + |
| 330 | + - name: Verify Redis connection |
| 331 | + run: python -c "import redis; redis.Redis(host='localhost', port=6379).ping(); print('Redis OK')" |
| 332 | + |
| 333 | + - name: Build/Setup test components |
| 334 | + run: npm run setup-tests.py |
| 335 | + |
| 336 | + - name: Run shared-storage tests |
| 337 | + run: pytest --headless tests/shared_storage -v |
| 338 | + |
259 | 339 | background-callbacks: |
260 | 340 | name: Run Background & Async Callback Tests (Python ${{ matrix.python-version }}) |
261 | 341 | needs: [build, changes_filter] |
@@ -625,6 +705,69 @@ jobs: |
625 | 705 | touch __init__.py |
626 | 706 | pytest --headless --nopercyfinalize tests/websocket -v -s |
627 | 707 |
|
| 708 | + streaming-tests: |
| 709 | + name: Streaming Callback Tests (Python ${{ matrix.python-version }}) |
| 710 | + needs: [build, changes_filter] |
| 711 | + if: | |
| 712 | + (github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev')) || |
| 713 | + needs.changes_filter.outputs.streaming_changed == 'true' |
| 714 | + timeout-minutes: 30 |
| 715 | + runs-on: ubuntu-latest |
| 716 | + strategy: |
| 717 | + fail-fast: false |
| 718 | + matrix: |
| 719 | + python-version: ["3.9", "3.12"] |
| 720 | + |
| 721 | + steps: |
| 722 | + - name: Checkout repository |
| 723 | + uses: actions/checkout@v4 |
| 724 | + |
| 725 | + - name: Set up Node.js |
| 726 | + uses: actions/setup-node@v4 |
| 727 | + with: |
| 728 | + node-version: '24' |
| 729 | + cache: 'npm' |
| 730 | + |
| 731 | + - name: Install Node.js dependencies |
| 732 | + run: npm ci |
| 733 | + |
| 734 | + - name: Set up Python ${{ matrix.python-version }} |
| 735 | + uses: actions/setup-python@v5 |
| 736 | + with: |
| 737 | + python-version: ${{ matrix.python-version }} |
| 738 | + cache: 'pip' |
| 739 | + cache-dependency-path: requirements/*.txt |
| 740 | + |
| 741 | + - name: Download built Dash packages |
| 742 | + uses: actions/download-artifact@v4 |
| 743 | + with: |
| 744 | + name: dash-packages |
| 745 | + path: packages/ |
| 746 | + |
| 747 | + - name: Install Dash packages |
| 748 | + # Streaming callbacks are async generators; the async extra pulls in |
| 749 | + # flask[async], which they require on the Flask backend. |
| 750 | + run: | |
| 751 | + python -m pip install --upgrade pip wheel |
| 752 | + python -m pip install "setuptools<80.0.0" |
| 753 | + find packages -name dash-*.whl -print -exec sh -c 'pip install "{}[async,ci,testing,dev,fastapi,quart]"' \; |
| 754 | +
|
| 755 | + - name: Setup Chrome and ChromeDriver |
| 756 | + uses: browser-actions/setup-chrome@v1 |
| 757 | + with: |
| 758 | + chrome-version: stable |
| 759 | + |
| 760 | + - name: Build/Setup test components |
| 761 | + run: npm run setup-tests.py |
| 762 | + |
| 763 | + - name: Run streaming tests |
| 764 | + run: | |
| 765 | + mkdir streamtests |
| 766 | + cp -r tests streamtests/tests |
| 767 | + cd streamtests |
| 768 | + touch __init__.py |
| 769 | + pytest --headless --nopercyfinalize tests/streaming -v -s |
| 770 | +
|
628 | 771 | test-main: |
629 | 772 | name: Main Dash Tests (Python ${{ matrix.python-version }}, React ${{ matrix.react-version }}, Group ${{ matrix.test-group }}) |
630 | 773 | needs: build |
|
0 commit comments