Skip to content

Commit

Permalink
chore: refactor tests directory structure (#241)
Browse files Browse the repository at this point in the history
  • Loading branch information
Timeless0911 authored Sep 27, 2024
1 parent 1c05552 commit 3ff6859
Show file tree
Hide file tree
Showing 329 changed files with 472 additions and 499 deletions.
23 changes: 8 additions & 15 deletions .github/workflows/test-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ on:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# ======== ut ========
ut-mac:
# run ut in MacOS, as SWC cases will fail in Ubuntu CI
runs-on: macos-14
ut-ubuntu:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
Expand Down Expand Up @@ -60,8 +59,8 @@ jobs:
if: steps.changes.outputs.changed == 'true'
run: pnpm run test:unit

# ======== e2e ========
e2e-ubuntu:
# ======== integration && e2e ========
integration-e2e-ubuntu:
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down Expand Up @@ -97,18 +96,12 @@ jobs:

- name: Install Dependencies
if: steps.changes.outputs.changed == 'true'
run: pnpm install && cd ./e2e && pnpx playwright install

- name: E2E Artifact Test (Vitest)
if: steps.changes.outputs.changed == 'true'
run: pnpm run test:artifact
run: pnpm install && cd ./tests && npx playwright install

- name: Examples Test
- name: Features Integration Test (Vitest)
if: steps.changes.outputs.changed == 'true'
run: |
pnpm run build:examples
run: pnpm run test:features

- name: E2E Test (Playwright)
- name: Examples E2E Test (Playwright)
if: steps.changes.outputs.changed == 'true'
run: pnpm run test:e2e

16 changes: 6 additions & 10 deletions .github/workflows/test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ jobs:
if: steps.changes.outputs.changed == 'true'
run: pnpm run test:unit

# # ======== e2e ========
e2e-windows:
# # ======== integration && e2e ========
integration-e2e-windows:
runs-on: windows-latest
strategy:
matrix:
Expand Down Expand Up @@ -106,16 +106,12 @@ jobs:

- name: Install Dependencies
if: steps.changes.outputs.changed == 'true'
run: pnpm install && cd ./e2e && npx playwright install
run: pnpm install && cd ./tests && npx playwright install

- name: E2E Artifact Test (Vitest)
- name: Features Integration Test (Vitest)
if: steps.changes.outputs.changed == 'true'
run: pnpm run test:artifact
run: pnpm run test:features

- name: Examples Test
if: steps.changes.outputs.changed == 'true'
run: pnpm run build:examples

- name: E2E Test (Playwright)
- name: Examples E2E Test (Playwright)
if: steps.changes.outputs.changed == 'true'
run: pnpm run test:e2e
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ doc_build/
playwright-report/
tsconfig.tsbuildinfo
test-temp-*
test-results

.vscode/**/*
!.vscode/settings.json
Expand Down
2 changes: 1 addition & 1 deletion biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
},
"linter": {
"enabled": true,
"ignore": ["./e2e/cases/**/*/src/*"],
"ignore": ["./tests/features/**/*/src/*"],
"rules": {
"recommended": true,
"style": {
Expand Down
34 changes: 0 additions & 34 deletions e2e/cases/copy/index.test.ts

This file was deleted.

62 changes: 0 additions & 62 deletions e2e/cases/sourcemap/index.test.ts

This file was deleted.

11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,17 @@
"changeset": "changeset",
"check-dependency-version": "check-dependency-version-consistency .",
"check-spell": "npx cspell",
"lint": "biome check . --diagnostic-level=warn && pnpm run check-spell",
"lint": "biome check . --diagnostic-level=warn && pnpm run check-spell",
"prebundle": "nx run-many -t prebundle",
"prepare": "pnpm run build && simple-git-hooks",
"sort-package-json": "npx sort-package-json \"packages/*/package.json\"",
"test:artifact": "vitest run --project artifact",
"test:artifact:watch": "vitest --project artifact",
"test:e2e": "cd e2e && pnpm run test",
"test": "pnpm run test:unit && pnpm run test:features && pnpm run test:e2e",
"test:e2e": "pnpm run build:examples && cd tests && pnpm run test:e2e",
"test:features": "vitest run --project features",
"test:features:watch": "vitest --project features",
"test:unit": "vitest run --project unit*",
"test:unit:watch": "vitest --project unit*",
"testu": "pnpm run test:unit -u && pnpm run test:artifact -u",
"test:update": "pnpm run test:unit -u && pnpm run test:features -u",
"update:rsbuild": "npx taze minor --include /rsbuild/ -w -r -l",
"watch": "pnpm build --watch"
},
Expand Down
Loading

0 comments on commit 3ff6859

Please sign in to comment.