-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* initialized recorder feature * finished settings fragment and fixed layout problem of feature settings * added unit and integration testing mechanism * added unit and integration test cases for recorder * finished recorder feature and test cases
- Loading branch information
Showing
81 changed files
with
24,172 additions
and
379 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,19 @@ | ||
name: Build And Test Extensions | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'develop' | ||
paths: | ||
- 'src/**' | ||
- 'tests/**' | ||
- 'playwright.config.ts' | ||
- 'pnpm-lock.yaml' | ||
- '.github/workflows/build-test.yml' | ||
pull_request: | ||
branches: [develop] | ||
branches: [develop, master] | ||
types: | ||
- opened | ||
- reopened | ||
- ready_for_review | ||
- review_requested | ||
paths: | ||
- 'src/**' | ||
- 'tests/**' | ||
- 'playwright.config.ts' | ||
- 'pnpm-lock.yaml' | ||
- '.github/workflows/build-test.yml' | ||
workflow_dispatch: | ||
inputs: | ||
debug: | ||
|
@@ -45,15 +42,63 @@ jobs: | |
run: pnpm install --frozen-lockfile | ||
- name: Build And Package Extensions | ||
run: pnpm build --zip --target=${{ matrix.browser }}-mv3 | ||
env: | ||
DEBUG: true | ||
# upload to github artifacts for each browser with matrix | ||
- name: Upload to GitHub Artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ matrix.browser }}-mv3 | ||
path: build/ | ||
test: | ||
test: # non-e2e test no need upload to r2 | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
project: [integrations, units] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Ensure No @Scoped Test | ||
run: grep -r --include "*.spec.ts" "@scoped" && echo "please remove @scoped from tests" && exit 1 || echo "No @scoped tests found" | ||
- uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8 | ||
- name: Setup Node.js | ||
uses: actions/[email protected] | ||
with: | ||
node-version: 20 | ||
cache: 'pnpm' | ||
- name: Install dependencies | ||
run: pnpm install --frozen-lockfile | ||
- name: Cache playwright binaries | ||
uses: actions/cache@v3 | ||
id: playwright-cache | ||
with: | ||
path: ~/.cache/ms-playwright | ||
key: ${{ runner.os }}-playwright-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
- name: Install Playwright Browsers | ||
run: pnpm exec playwright install --with-deps | ||
if: steps.playwright-cache.outputs.cache-hit != 'true' | ||
- name: Test | ||
id: test | ||
run: | | ||
if [ "${{ inputs.debug }}" == "true" ]; then | ||
echo "Enabled Debug Mode" | ||
export DEBUG=true | ||
fi | ||
pnpm test -- --project=${{ matrix.project }} --max-failures=5 | ||
- name: Upload Test Results | ||
if: always() && steps.test.conclusion != 'skipped' | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ matrix.project }}-test-results | ||
path: | | ||
test-results/ | ||
playwright-report/ | ||
if-no-files-found: ignore | ||
e2e-test: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
needs: [build, test] | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
|
@@ -100,7 +145,7 @@ jobs: | |
run: | | ||
if [ "${{ inputs.debug }}" == "true" ]; then | ||
echo "Enabled Debug Mode" | ||
export DEBUG="pw:api" | ||
export DEBUG=true | ||
fi | ||
pnpm test -- --project=${{ steps.project.outputs.project }} | ||
- name: Upload Test Results | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,6 @@ on: | |
- 'tests/**' | ||
- 'playwright.config.ts' | ||
- 'pnpm-lock.yaml' | ||
- '.github/workflows/build-test.yml' | ||
workflow_dispatch: | ||
inputs: | ||
debug: | ||
|
@@ -21,6 +20,43 @@ on: | |
jobs: | ||
fast-test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
project: [units, integrations] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8 | ||
- name: Setup Node.js | ||
uses: actions/[email protected] | ||
with: | ||
node-version: 20 | ||
cache: 'pnpm' | ||
- name: Install dependencies | ||
run: pnpm install --frozen-lockfile | ||
- name: Cache playwright binaries | ||
uses: actions/cache@v3 | ||
id: playwright-cache | ||
with: | ||
path: ~/.cache/ms-playwright | ||
key: ${{ runner.os }}-playwright-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
- run: pnpm exec playwright install --with-deps | ||
if: steps.playwright-cache.outputs.cache-hit != 'true' | ||
- name: Test | ||
id: test | ||
run: | | ||
pnpm test -- --project=${{ matrix.project }} \ | ||
--grep=@scoped \ | ||
--pass-with-no-tests \ | ||
--global-timeout=3600000 \ | ||
--max-failures=2 | ||
env: | ||
DEBUG: true | ||
fast-e2e-test: | ||
runs-on: ubuntu-latest | ||
needs: fast-test | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
|
@@ -39,6 +75,8 @@ jobs: | |
run: pnpm install --frozen-lockfile | ||
- name: Build Extension and Prepare Tests | ||
run: pnpm test:rebuild | ||
env: | ||
DEBUG: true | ||
- name: Cache playwright binaries | ||
uses: actions/cache@v3 | ||
id: playwright-cache | ||
|
@@ -57,4 +95,13 @@ jobs: | |
--timeout=60000 \ | ||
--max-failures=5 | ||
env: | ||
DEBUG: true | ||
DEBUG: true | ||
- name: Upload Test Results | ||
if: failure() && steps.test.conclusion != 'skipped' | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ matrix.browser }}-test-results | ||
path: | | ||
test-results/ | ||
playwright-report/ | ||
if-no-files-found: ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.