Skip to content

Commit

Permalink
Update CI (#11)
Browse files Browse the repository at this point in the history
* update workflow

* add api key

* test

* fix

* fix

* fix

* test

* fix test

* fix test

* remove pr trigger

* fix

* fix test

* fix perm

* test workflow

* fix test workflow

* fix test workflow

* fix test workflow

* fix test workflow

* final(?) test

* update worker

* use class name

* fix toggle server endpoint

* update comment

* rm api key file

* fix

* Update snapshots (#12)

* Update test expectations [skip ci]

* rm old snapshots

* Update test expectations [skip ci]

---------

Co-authored-by: wjymtg <[email protected]>

* fix

* test

* fix

---------

Co-authored-by: wjymtg <[email protected]>
  • Loading branch information
wjymtg and wjymtg authored Dec 13, 2024
1 parent fd21b24 commit 04ac8df
Show file tree
Hide file tree
Showing 431 changed files with 164 additions and 148 deletions.
22 changes: 13 additions & 9 deletions .github/workflows/browser_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ name: Browser Tests

on:
workflow_dispatch:
push:
branches:
- dev_bbs
# TODO: add master when it's ready
pull_request:
types: [opened, synchronize, reopened]
paths-ignore:
- 'browser_tests/*snapshots'

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true

env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
Expand Down Expand Up @@ -77,11 +79,14 @@ jobs:
npm install
working-directory: ComfyUI/custom_nodes/BizyAir/bizyair_frontend

- name: Copy over test workflows
- name: Set up test environment
run: |
mkdir -p ComfyUI/user/default
cp -r ComfyUI/custom_nodes/BizyAir/bizyair_frontend/browser_tests/workflows ComfyUI/user/default
python3 ComfyUI/custom_nodes/BizyAir/tests/write_api_ini_file.py
env:
BIZYAIR_KEY: ${{ secrets.BIZYAIR_KEY }}

- name: Update bizyair_frontend.js
run: |
npx vue-tsc -b
Expand All @@ -95,13 +100,12 @@ jobs:
working-directory: ComfyUI

- name: Run Tests
continue-on-error: true
run: |
npx playwright test --project chromium chromium-2x
npx playwright test --project chromium chromium-2x --workers=4
working-directory: ComfyUI/custom_nodes/BizyAir/bizyair_frontend/browser_tests

- uses: actions/upload-artifact@v4
if: always()
if: success() || failure()
with:
name: playwright-report
path: ComfyUI/custom_nodes/BizyAir/bizyair_frontend/browser_tests/playwright-report/
Expand Down
40 changes: 22 additions & 18 deletions .github/workflows/update_browser_exp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ name: Update Browser Tests Expectations

on:
workflow_dispatch:
# TODO: more proper trigger

permissions:
contents: write

jobs:
update_browser_expectations:
Expand Down Expand Up @@ -33,9 +35,6 @@ jobs:
uses: actions/checkout@v4
with:
repository: siliconflow/bizyair_frontend
# TODO: update after PR is merged
# TODO2: use master when it's ready
ref: dev_bbs_ci
path: ComfyUI/custom_nodes/BizyAir/bizyair_frontend

- uses: actions/setup-python@v4
Expand Down Expand Up @@ -71,10 +70,13 @@ jobs:
npm install
working-directory: ComfyUI/custom_nodes/BizyAir/bizyair_frontend

- name: Copy over test workflows
- name: Set up test environment
run: |
mkdir -p ComfyUI/user/default
cp -r ComfyUI/custom_nodes/BizyAir/bizyair_frontend/browser_tests/workflows ComfyUI/user/default
python3 ComfyUI/custom_nodes/BizyAir/tests/write_api_ini_file.py
env:
BIZYAIR_KEY: ${{ secrets.BIZYAIR_KEY }}

- name: Update bizyair_frontend.js
run: |
Expand All @@ -90,30 +92,32 @@ jobs:

- name: Run Playwright tests and update snapshots
run: |
npx playwright test --update-snapshots --project chromium chromium-2x
continue-on-error: true
npx playwright test --update-snapshots --project chromium chromium-2x --workers=4
working-directory: ComfyUI/custom_nodes/BizyAir/bizyair_frontend/browser_tests

- uses: actions/upload-artifact@v4
if: always()
if: success() || failure()
with:
name: playwright-report
path: ComfyUI/custom_nodes/BizyAir/bizyair_frontend/browser_tests/playwright-report/
retention-days: 30

- name: Debugging info
if: success()
run: |
git status
working-directory: ComfyUI/custom_nodes/BizyAir/bizyair_frontend/browser_tests

# TODO: if need to support PR, refer to https://github.com/Comfy-Org/ComfyUI_frontend/blob/57701f6145f622bf17237410c165966fb4aecc75/.github/workflows/test-browser-exp.yaml
# Using a dedicated branch to update test expectations, because
# master is protected, updated images need to push to that branch and PR to master
# NOTE: PR from github action bot is not enabled so need to manually create a PR
- name: Commit updated expectations
continue-on-error: true
run: |
git config --global user.name 'github-actions'
git config --global user.email '[email protected]'
git fetch
git add .
git commit -m "Update test expectations [skip ci]"
git push
working-directory: ComfyUI/custom_nodes/BizyAir/bizyair_frontend/browser_tests
if: success()
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Update test expectations [skip ci]"
file_pattern: "*.png"
branch: update_snapshots
skip_fetch: false
skip_checkout: false
repository: ComfyUI/custom_nodes/BizyAir/bizyair_frontend/browser_tests
Loading

0 comments on commit 04ac8df

Please sign in to comment.