|
16 | 16 | outputs: |
17 | 17 | table_paths_changed: ${{ steps.filter.outputs.table_related_paths }} |
18 | 18 | background_cb_changed: ${{ steps.filter.outputs.background_paths }} |
| 19 | + backend_cb_changed: ${{ steps.filter.outputs.backend_paths }} |
19 | 20 | dcc_paths_changed: ${{ steps.filter.outputs.dcc_related_paths }} |
20 | 21 | html_paths_changed: ${{ steps.filter.outputs.html_related_paths }} |
| 22 | + websocket_changed: ${{ steps.filter.outputs.websocket_paths }} |
21 | 23 | steps: |
22 | 24 | - name: Checkout repository |
23 | 25 | uses: actions/checkout@v4 |
|
44 | 46 | - 'tests/background_callback/**' |
45 | 47 | - 'tests/async_tests/**' |
46 | 48 | - 'requirements/**' |
| 49 | + backend_paths: |
| 50 | + - 'dash/backends/**' |
| 51 | + - 'tests/backend_tests/**' |
| 52 | + websocket_paths: |
| 53 | + - 'dash/backends/_fastapi.py' |
| 54 | + - 'dash/backends/_quart.py' |
| 55 | + - 'dash/backends/base_server.py' |
| 56 | + - 'dash/_callback.py' |
| 57 | + - 'dash/_callback_context.py' |
| 58 | + - 'dash/_hooks.py' |
| 59 | + - 'dash/dash.py' |
| 60 | + - '@dash-websocket-worker/**' |
| 61 | + - 'dash/dash-renderer/src/**' |
| 62 | + - 'tests/websocket/**' |
| 63 | + - 'requirements/**' |
47 | 64 |
|
48 | 65 | lint-unit: |
49 | 66 | name: Lint & Unit Tests (Python ${{ matrix.python-version }}) |
@@ -329,6 +346,80 @@ jobs: |
329 | 346 | path: bgtests/test-reports/ |
330 | 347 | retention-days: 7 |
331 | 348 |
|
| 349 | + backend-tests: |
| 350 | + name: Run Backend Callback Tests (Python ${{ matrix.python-version }}) |
| 351 | + needs: [build, changes_filter] |
| 352 | + if: | |
| 353 | + (github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev')) || |
| 354 | + needs.changes_filter.outputs.backend_cb_changed == 'true' |
| 355 | + timeout-minutes: 30 |
| 356 | + runs-on: ubuntu-latest |
| 357 | + strategy: |
| 358 | + fail-fast: false |
| 359 | + matrix: |
| 360 | + python-version: ["3.9", "3.12"] |
| 361 | + |
| 362 | + services: |
| 363 | + redis: |
| 364 | + image: redis:6 |
| 365 | + ports: |
| 366 | + - 6379:6379 |
| 367 | + options: >- |
| 368 | + --health-cmd "redis-cli ping" |
| 369 | + --health-interval 10s |
| 370 | + --health-timeout 5s |
| 371 | + --health-retries 5 |
| 372 | +
|
| 373 | + env: |
| 374 | + REDIS_URL: redis://localhost:6379 |
| 375 | + steps: |
| 376 | + - name: Checkout repository |
| 377 | + uses: actions/checkout@v4 |
| 378 | + |
| 379 | + - name: Set up Node.js |
| 380 | + uses: actions/setup-node@v4 |
| 381 | + with: |
| 382 | + node-version: '24' |
| 383 | + cache: 'npm' |
| 384 | + |
| 385 | + - name: Install Node.js dependencies |
| 386 | + run: npm ci |
| 387 | + |
| 388 | + - name: Set up Python ${{ matrix.python-version }} |
| 389 | + uses: actions/setup-python@v5 |
| 390 | + with: |
| 391 | + python-version: ${{ matrix.python-version }} |
| 392 | + cache: 'pip' |
| 393 | + cache-dependency-path: requirements/*.txt |
| 394 | + |
| 395 | + - name: Download built Dash packages |
| 396 | + uses: actions/download-artifact@v4 |
| 397 | + with: |
| 398 | + name: dash-packages |
| 399 | + path: packages/ |
| 400 | + |
| 401 | + - name: Install Dash packages |
| 402 | + run: | |
| 403 | + python -m pip install --upgrade pip wheel |
| 404 | + python -m pip install "setuptools<80.0.0" |
| 405 | + find packages -name dash-*.whl -print -exec sh -c 'pip install "{}[async,ci,testing,dev,celery,diskcache,fastapi,quart]"' \; |
| 406 | +
|
| 407 | + - name: Setup Chrome and ChromeDriver |
| 408 | + uses: browser-actions/setup-chrome@v1 |
| 409 | + with: |
| 410 | + chrome-version: stable |
| 411 | + |
| 412 | + - name: Build/Setup test components |
| 413 | + run: npm run setup-tests.py |
| 414 | + |
| 415 | + - name: Run Backend Callback Tests |
| 416 | + run: | |
| 417 | + mkdir bgtests |
| 418 | + cp -r tests bgtests/tests |
| 419 | + cd bgtests |
| 420 | + touch __init__.py |
| 421 | + pytest --headless --nopercyfinalize tests/backend_tests -v -s |
| 422 | +
|
332 | 423 | table-unit: |
333 | 424 | name: Table Unit/Lint Tests (Python ${{ matrix.python-version }}) |
334 | 425 | needs: [build, changes_filter] |
@@ -451,6 +542,67 @@ jobs: |
451 | 542 | path: components/dash-table/test-reports/ |
452 | 543 | retention-days: 7 |
453 | 544 |
|
| 545 | + websocket-tests: |
| 546 | + name: WebSocket Tests (Python ${{ matrix.python-version }}) |
| 547 | + needs: [build, changes_filter] |
| 548 | + if: | |
| 549 | + (github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev')) || |
| 550 | + needs.changes_filter.outputs.websocket_changed == 'true' |
| 551 | + timeout-minutes: 30 |
| 552 | + runs-on: ubuntu-latest |
| 553 | + strategy: |
| 554 | + fail-fast: false |
| 555 | + matrix: |
| 556 | + python-version: ["3.9", "3.12"] |
| 557 | + |
| 558 | + steps: |
| 559 | + - name: Checkout repository |
| 560 | + uses: actions/checkout@v4 |
| 561 | + |
| 562 | + - name: Set up Node.js |
| 563 | + uses: actions/setup-node@v4 |
| 564 | + with: |
| 565 | + node-version: '24' |
| 566 | + cache: 'npm' |
| 567 | + |
| 568 | + - name: Install Node.js dependencies |
| 569 | + run: npm ci |
| 570 | + |
| 571 | + - name: Set up Python ${{ matrix.python-version }} |
| 572 | + uses: actions/setup-python@v5 |
| 573 | + with: |
| 574 | + python-version: ${{ matrix.python-version }} |
| 575 | + cache: 'pip' |
| 576 | + cache-dependency-path: requirements/*.txt |
| 577 | + |
| 578 | + - name: Download built Dash packages |
| 579 | + uses: actions/download-artifact@v4 |
| 580 | + with: |
| 581 | + name: dash-packages |
| 582 | + path: packages/ |
| 583 | + |
| 584 | + - name: Install Dash packages |
| 585 | + run: | |
| 586 | + python -m pip install --upgrade pip wheel |
| 587 | + python -m pip install "setuptools<80.0.0" |
| 588 | + find packages -name dash-*.whl -print -exec sh -c 'pip install "{}[ci,testing,dev,fastapi,quart]"' \; |
| 589 | +
|
| 590 | + - name: Setup Chrome and ChromeDriver |
| 591 | + uses: browser-actions/setup-chrome@v1 |
| 592 | + with: |
| 593 | + chrome-version: stable |
| 594 | + |
| 595 | + - name: Build/Setup test components |
| 596 | + run: npm run setup-tests.py |
| 597 | + |
| 598 | + - name: Run WebSocket tests |
| 599 | + run: | |
| 600 | + mkdir wstests |
| 601 | + cp -r tests wstests/tests |
| 602 | + cd wstests |
| 603 | + touch __init__.py |
| 604 | + pytest --headless --nopercyfinalize tests/websocket -v -s |
| 605 | +
|
454 | 606 | test-main: |
455 | 607 | name: Main Dash Tests (Python ${{ matrix.python-version }}, Group ${{ matrix.test-group }}) |
456 | 608 | needs: build |
|
0 commit comments