Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/composite/install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ description: 'Sets up Node.js and runs install'
runs:
using: composite
steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
with:
run_install: false
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: 'Run Visual Regression Tests'
name: "Run Visual Regression Tests"

'on':
"on":
workflow_dispatch:
pull_request:
types:
Expand All @@ -18,11 +18,19 @@ env:
AWS_REGION: ${{ secrets.AWS_REGION }}
AWS_IAM_ROLE_NAME: ${{ secrets.AWS_IAM_ROLE_NAME }}
AWS_IAM_ROLE_SESSION_NAME: ${{ secrets.AWS_IAM_ROLE_SESSION_NAME }}
REPORT_PATH: ''
REPORT_PATH: ""

jobs:
visual-regression:
runs-on: macos-latest
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
shardIndex: [1, 2, 3, 4]
shardTotal: [4]
container:
image: mcr.microsoft.com/playwright:v1.55.0-noble
options: --user 1001
steps:
- name: Git clone the repository
uses: actions/checkout@v4
Expand All @@ -32,35 +40,73 @@ jobs:
- name: Install Dependencies
uses: ./.github/composite/install

- name: Install Playwright Browsers
uses: ./.github/composite/browser-install
with:
working-directory: packages/core
# - name: Install Playwright Browsers
# uses: ./.github/composite/browser-install
# with:
# working-directory: packages/core

- name: Build Icons
run: pnpm icons build
run: pnpm build --filter=@vapor-ui/icons

- name: Build Storybook
run: pnpm build-storybook

- name: Run Snapshot Tests
run: pnpm core test:visual

- uses: actions/upload-artifact@v4
if: '${{ !cancelled() }}'
- name: Run Playwright tests
run: npx playwright test --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}

- name: Upload blob report to GitHub Actions Artifacts
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: blob-report-${{ matrix.shardIndex }}
path: blob-report
retention-days: 1

# - uses: actions/upload-artifact@v4
# if: "${{ !cancelled() }}"
# with:
# name: test-results
# path: ./packages/core/__tests__/report/

merge-reports:
if: ${{ !cancelled() }}
needs: [visual-regression]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Dependencies
uses: ./.github/composite/install

- name: Download blob reports from GitHub Actions Artifacts
uses: actions/download-artifact@v4
with:
path: all-blob-reports
pattern: blob-report-*
merge-multiple: true

- name: Merge into HTML Report
run: npx playwright merge-reports --reporter html ./all-blob-reports

- name: Upload HTML report
uses: actions/upload-artifact@v4
with:
name: test-results
path: ./packages/core/__tests__/report/
name: html-report--attempt-${{ github.run_attempt }}
path: playwright-report
retention-days: 14

deploy-report:
needs: visual-regression
needs: merge-reports
if: always()
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
name: test-results
path: ./report/
name: html-report--attempt-${{ github.run_attempt }}
path: playwright-report

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
Expand Down Expand Up @@ -122,7 +168,7 @@ jobs:
- uses: marocchino/sticky-pull-request-comment@v2
with:
message: |
${{ needs.visual-regression.result == 'failure' && format('🚫 **{0} tests failed!**', steps.parse-results.outputs.failed) || '✅ **All tests passed!**' }}
${{ needs.merge-reports.result == 'failure' && format('🚫 **{0} tests failed!**', steps.parse-results.outputs.failed) || '✅ **All tests passed!**' }}

| Tests | Passed | Failed | Duration | Report |
| :---- | :----- | :----- | :------- | :----- |
Expand Down
10 changes: 2 additions & 8 deletions packages/core/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,8 @@ export default defineConfig({
projects: [
{ name: 'firefox', use: { ...devices['Desktop Firefox'] } },
{ name: 'webkit', use: { ...devices['Desktop Safari'] } },
{
name: 'chromium',
use: { ...devices['Desktop Chrome'], channel: 'chrome' },
},
{
name: 'Microsoft Edge',
use: { ...devices['Desktop Edge'], channel: 'msedge' },
},
{ name: 'chromium', use: { ...devices['Desktop Chrome'] } },
{ name: 'Microsoft Edge', use: { ...devices['Desktop Edge'] } },

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

channel 속성을 제거하면 Playwright는 시스템에 설치된 Chrome이나 Edge 브라우저 대신 번들로 제공되는 Chromium 빌드를 사용하게 됩니다. 이로 인해 CI 환경과 로컬 개발 환경 간에 테스트 브라우저가 달라져 렌더링 차이가 발생할 수 있으며, 이는 시각적 회귀 테스트(VRT)의 신뢰성에 영향을 줄 수 있습니다.

만약 CI 환경에서 특정 브라우저(Chrome, Edge) 설치를 피하고 일관된 테스트 환경을 구축하려는 의도라면 이 변경이 타당할 수 있습니다. 하지만, 실제 사용자가 사용하는 브라우저와 최대한 유사한 환경에서 테스트하는 것이 목적이라면 channel 속성을 유지하는 것을 고려해 보세요.

이 변경으로 인해 테스트가 실패하거나 예기치 않은 시각적 차이가 발생할 수 있으므로, 변경의 영향을 신중히 검토해 보시길 권장합니다.

        {
            name: 'chromium',
            use: { ...devices['Desktop Chrome'], channel: 'chrome' },
        },
        {
            name: 'Microsoft Edge',
            use: { ...devices['Desktop Edge'], channel: 'msedge' },
        },

],

workers: 1,
Expand Down
Loading