|
60 | 60 | - name: Run type tests |
61 | 61 | run: npm run test:types |
62 | 62 |
|
63 | | - test-site: |
64 | | - runs-on: blacksmith-4vcpu-ubuntu-2404 |
65 | | - timeout-minutes: 8 |
66 | | - needs: lint |
67 | | - |
68 | | - steps: |
69 | | - - uses: actions/checkout@v4 |
70 | | - |
71 | | - - name: Use Node.js 22 |
72 | | - uses: actions/setup-node@v4 |
73 | | - with: |
74 | | - node-version: 22 |
75 | | - cache: 'npm' |
76 | | - |
77 | | - - name: Install CLI dependencies |
78 | | - run: npm ci |
79 | | - |
80 | | - - name: Build CLI |
81 | | - run: npm run build |
82 | | - |
83 | | - - name: Install test site dependencies |
84 | | - working-directory: ./test-site |
85 | | - run: npm ci |
86 | | - |
87 | | - - name: Get installed Playwright version |
88 | | - working-directory: ./test-site |
89 | | - id: playwright-version |
90 | | - run: echo "version=$(npx playwright --version | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')" >> $GITHUB_OUTPUT |
91 | | - |
92 | | - - name: Cache Playwright browsers |
93 | | - uses: actions/cache@v4 |
94 | | - id: playwright-cache |
95 | | - with: |
96 | | - path: ~/.cache/ms-playwright |
97 | | - key: playwright-browsers-${{ steps.playwright-version.outputs.version }}-firefox |
98 | | - |
99 | | - - name: Install Playwright browsers |
100 | | - if: steps.playwright-cache.outputs.cache-hit != 'true' |
101 | | - working-directory: ./test-site |
102 | | - run: npx playwright install firefox --with-deps |
103 | | - |
104 | | - - name: Test Vizzly integration |
105 | | - working-directory: ./test-site |
106 | | - run: node ../bin/vizzly.js run "npm test" |
107 | | - env: |
108 | | - CI: true |
109 | | - VIZZLY_TOKEN: ${{ secrets.VIZZLY_TOKEN }} |
110 | | - VIZZLY_COMMIT_MESSAGE: ${{ github.event.pull_request.head.commit.message || github.event.head_commit.message }} |
111 | | - VIZZLY_COMMIT_SHA: ${{ github.event.pull_request.head.sha || github.event.head_commit.id }} |
112 | | - |
113 | 63 | test-reporter: |
114 | 64 | runs-on: blacksmith-4vcpu-ubuntu-2404 |
115 | 65 | timeout-minutes: 8 |
@@ -408,6 +358,109 @@ jobs: |
408 | 358 | working-directory: ./clients/static-site |
409 | 359 | run: npm run build |
410 | 360 |
|
| 361 | + # SDK E2E Integration Tests |
| 362 | + # Always runs to catch CLI changes that break SDK integrations |
| 363 | + # Tests the full flow: test runner -> SDK -> CLI server -> visual comparison |
| 364 | + test-sdk-e2e: |
| 365 | + runs-on: blacksmith-4vcpu-ubuntu-2404 |
| 366 | + timeout-minutes: 12 |
| 367 | + needs: lint |
| 368 | + |
| 369 | + steps: |
| 370 | + - uses: actions/checkout@v4 |
| 371 | + |
| 372 | + - name: Use Node.js 22 |
| 373 | + uses: actions/setup-node@v4 |
| 374 | + with: |
| 375 | + node-version: 22 |
| 376 | + cache: 'npm' |
| 377 | + |
| 378 | + - name: Install CLI dependencies |
| 379 | + run: npm ci |
| 380 | + |
| 381 | + - name: Build CLI |
| 382 | + run: npm run build |
| 383 | + |
| 384 | + # Shared Playwright setup (used by multiple SDKs) |
| 385 | + - name: Get Playwright version |
| 386 | + id: playwright-version |
| 387 | + run: echo "version=$(npx playwright --version | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')" >> $GITHUB_OUTPUT |
| 388 | + |
| 389 | + - name: Cache Playwright browsers |
| 390 | + uses: actions/cache@v4 |
| 391 | + id: playwright-cache |
| 392 | + with: |
| 393 | + path: ~/.cache/ms-playwright |
| 394 | + key: playwright-${{ steps.playwright-version.outputs.version }}-chromium-firefox |
| 395 | + |
| 396 | + - name: Install Playwright browsers |
| 397 | + if: steps.playwright-cache.outputs.cache-hit != 'true' |
| 398 | + run: npx playwright install chromium firefox --with-deps |
| 399 | + |
| 400 | + # Core JS Client SDK (vizzlyScreenshot function) |
| 401 | + - name: Install test-site dependencies |
| 402 | + working-directory: ./test-site |
| 403 | + run: npm ci |
| 404 | + |
| 405 | + - name: Run Core JS Client E2E tests |
| 406 | + working-directory: ./test-site |
| 407 | + run: node ../bin/vizzly.js run "npm test" |
| 408 | + env: |
| 409 | + CI: true |
| 410 | + VIZZLY_TOKEN: ${{ secrets.VIZZLY_TOKEN }} |
| 411 | + VIZZLY_COMMIT_MESSAGE: ${{ github.event.pull_request.head.commit.message || github.event.head_commit.message }} |
| 412 | + VIZZLY_COMMIT_SHA: ${{ github.event.pull_request.head.sha || github.event.head_commit.id }} |
| 413 | + |
| 414 | + # Vitest SDK (toMatchScreenshot matcher) |
| 415 | + - name: Install Vitest client dependencies |
| 416 | + working-directory: ./clients/vitest |
| 417 | + run: npm install |
| 418 | + |
| 419 | + - name: Run Vitest SDK E2E tests |
| 420 | + working-directory: ./clients/vitest |
| 421 | + run: ../../bin/vizzly.js run "npm run test:e2e" |
| 422 | + env: |
| 423 | + CI: true |
| 424 | + VIZZLY_TOKEN: ${{ secrets.VIZZLY_VITEST_CLIENT_TOKEN }} |
| 425 | + VIZZLY_COMMIT_MESSAGE: ${{ github.event.pull_request.head.commit.message || github.event.head_commit.message }} |
| 426 | + VIZZLY_COMMIT_SHA: ${{ github.event.pull_request.head.sha || github.event.head_commit.id }} |
| 427 | + |
| 428 | + # Ember SDK (vizzlyScreenshot helper with Testem + Playwright) |
| 429 | + - name: Install Ember client dependencies |
| 430 | + working-directory: ./clients/ember |
| 431 | + run: npm install |
| 432 | + |
| 433 | + - name: Run Ember SDK E2E tests |
| 434 | + working-directory: ./clients/ember |
| 435 | + run: | |
| 436 | + cd test-app |
| 437 | + npm install |
| 438 | + npm run build -- --mode development |
| 439 | + ../../../bin/vizzly.js run "npx testem ci --file testem.cjs" |
| 440 | + env: |
| 441 | + CI: true |
| 442 | + VIZZLY_TOKEN: ${{ secrets.VIZZLY_EMBER_CLIENT_TOKEN }} |
| 443 | + VIZZLY_COMMIT_MESSAGE: ${{ github.event.pull_request.head.commit.message || github.event.head_commit.message }} |
| 444 | + VIZZLY_COMMIT_SHA: ${{ github.event.pull_request.head.sha || github.event.head_commit.id }} |
| 445 | + |
| 446 | + # Ruby SDK (Vizzly.screenshot with TDD server) |
| 447 | + - name: Set up Ruby |
| 448 | + uses: ruby/setup-ruby@v1 |
| 449 | + with: |
| 450 | + ruby-version: '3.3' |
| 451 | + |
| 452 | + - name: Install Ruby dependencies |
| 453 | + working-directory: ./clients/ruby |
| 454 | + run: | |
| 455 | + gem install bundler |
| 456 | + bundle install |
| 457 | +
|
| 458 | + - name: Run Ruby SDK integration tests |
| 459 | + working-directory: ./clients/ruby |
| 460 | + run: VIZZLY_INTEGRATION=1 ruby -I lib test/integration_test.rb |
| 461 | + env: |
| 462 | + CI: true |
| 463 | + |
411 | 464 | test-vitest-client: |
412 | 465 | runs-on: blacksmith-4vcpu-ubuntu-2404 |
413 | 466 | timeout-minutes: 8 |
@@ -463,16 +516,6 @@ jobs: |
463 | 516 | env: |
464 | 517 | CI: true |
465 | 518 |
|
466 | | - - name: Run Vitest client E2E tests |
467 | | - if: matrix.node-version == 22 |
468 | | - working-directory: ./clients/vitest |
469 | | - run: ../../bin/vizzly.js run "npm run test:e2e" |
470 | | - env: |
471 | | - CI: true |
472 | | - VIZZLY_TOKEN: ${{ secrets.VIZZLY_VITEST_CLIENT_TOKEN }} |
473 | | - VIZZLY_COMMIT_MESSAGE: ${{ github.event.pull_request.head.commit.message || github.event.head_commit.message }} |
474 | | - VIZZLY_COMMIT_SHA: ${{ github.event.pull_request.head.sha || github.event.head_commit.id }} |
475 | | - |
476 | 519 | test-swift-client: |
477 | 520 | runs-on: macos-latest |
478 | 521 | timeout-minutes: 8 |
@@ -569,13 +612,13 @@ jobs: |
569 | 612 |
|
570 | 613 | ci-check: |
571 | 614 | runs-on: ubuntu-latest |
572 | | - needs: [lint, test, test-site, test-reporter, test-tui, changes-ruby, test-ruby-client, changes-storybook, test-storybook-client, changes-static-site, test-static-site-client, changes-vitest, test-vitest-client, changes-swift, test-swift-client, changes-ember, test-ember-client] |
| 615 | + needs: [lint, test, test-reporter, test-tui, test-sdk-e2e, changes-ruby, test-ruby-client, changes-storybook, test-storybook-client, changes-static-site, test-static-site-client, changes-vitest, test-vitest-client, changes-swift, test-swift-client, changes-ember, test-ember-client] |
573 | 616 | if: always() |
574 | 617 | steps: |
575 | 618 | - name: Check if all jobs passed |
576 | 619 | run: | |
577 | 620 | # Required jobs that always run |
578 | | - if [[ "${{ needs.lint.result }}" == "failure" || "${{ needs.test.result }}" == "failure" || "${{ needs.test-site.result }}" == "failure" || "${{ needs.test-reporter.result }}" == "failure" || "${{ needs.test-tui.result }}" == "failure" ]]; then |
| 621 | + if [[ "${{ needs.lint.result }}" == "failure" || "${{ needs.test.result }}" == "failure" || "${{ needs.test-reporter.result }}" == "failure" || "${{ needs.test-tui.result }}" == "failure" || "${{ needs.test-sdk-e2e.result }}" == "failure" ]]; then |
579 | 622 | echo "One or more required jobs failed" |
580 | 623 | exit 1 |
581 | 624 | fi |
|
0 commit comments