diff --git a/.github/actions/copilot-test/action.yml b/.github/actions/copilot-test/action.yml index abd0101691..cb75daafec 100644 --- a/.github/actions/copilot-test/action.yml +++ b/.github/actions/copilot-test/action.yml @@ -3,7 +3,7 @@ description: 'Run Copilot E2E Test' inputs: script: description: 'Script to run' - default: 'yarn affine @affine-test/affine-cloud-copilot test:e2e --forbid-only' + default: 'yarn affine @affine-test/affine-cloud-copilot e2e --forbid-only' required: false openai-key: description: 'OpenAI secret key' diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 2f8bae6131..04acbdaee3 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -504,7 +504,7 @@ jobs: filters: | changed: - 'packages/backend/server/src/plugins/copilot/**' - - 'packages/backend/server/tests/copilot.*' + - 'packages/backend/server/tests/copilot*' - 'tests/affine-cloud-copilot/**' - name: Setup Node.js @@ -618,7 +618,7 @@ jobs: if: ${{ steps.check-blocksuite-update.outputs.skip != 'true' || steps.e2efilter.outputs.changed == 'true' }} uses: ./.github/actions/copilot-test with: - script: yarn affine @affine-test/affine-cloud-copilot test:e2e --forbid-only --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} + script: yarn affine @affine-test/affine-cloud-copilot e2e --forbid-only --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} openai-key: ${{ secrets.COPILOT_OPENAI_API_KEY }} fal-key: ${{ secrets.COPILOT_FAL_API_KEY }} perplexity-key: ${{ secrets.COPILOT_PERPLEXITY_API_KEY }} diff --git a/.github/workflows/copilot-test.yml b/.github/workflows/copilot-test.yml index be9d3ab70e..a1cbbee975 100644 --- a/.github/workflows/copilot-test.yml +++ b/.github/workflows/copilot-test.yml @@ -156,7 +156,7 @@ jobs: - name: Run Copilot E2E Test ${{ matrix.shardIndex }}/${{ matrix.shardTotal }} uses: ./.github/actions/copilot-test with: - script: yarn affine @affine-test/affine-cloud-copilot test:e2e --forbid-only --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} + script: yarn affine @affine-test/affine-cloud-copilot e2e --forbid-only --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} openai-key: ${{ secrets.COPILOT_OPENAI_API_KEY }} fal-key: ${{ secrets.COPILOT_FAL_API_KEY }} perplexity-key: ${{ secrets.COPILOT_PERPLEXITY_API_KEY }} diff --git a/packages/backend/server/package.json b/packages/backend/server/package.json index 89974eb412..c5a32e00c9 100644 --- a/packages/backend/server/package.json +++ b/packages/backend/server/package.json @@ -12,10 +12,10 @@ "dev": "nodemon ./src/index.ts", "dev:mail": "email dev -d src/mails", "test": "ava --concurrency 1 --serial", - "test:copilot:e2e": "ava \"e2e/copilot.e2e.ts\"", + "test:copilot:e2e": "ava \"src/__tests__/**/copilot-*.e2e.ts\"", "test:copilot:spec": "ava \"src/__tests__/**/copilot-*.spec.ts\"", "test:coverage": "c8 ava --concurrency 1 --serial", - "test:copilot:e2e:coverage": "c8 ava --timeout=5m \"e2e/copilot.e2e.ts\"", + "test:copilot:e2e:coverage": "c8 ava --timeout=5m \"src/__tests__/**/copilot-*.e2e.ts\"", "test:copilot:spec:coverage": "c8 ava --timeout=5m \"src/__tests__/**/copilot-*.spec.ts\"", "data-migration": "cross-env NODE_ENV=script r ./src/data/index.ts", "predeploy": "yarn prisma migrate deploy && NODE_ENV=script node --import ./scripts/register.js ./dist/data/index.js run", diff --git a/tests/affine-cloud/copilot/e2e/copilot.spec.ts b/tests/affine-cloud-copilot/e2e/copilot.spec.ts similarity index 100% rename from tests/affine-cloud/copilot/e2e/copilot.spec.ts rename to tests/affine-cloud-copilot/e2e/copilot.spec.ts diff --git a/tests/affine-cloud/copilot/package.json b/tests/affine-cloud-copilot/package.json similarity index 85% rename from tests/affine-cloud/copilot/package.json rename to tests/affine-cloud-copilot/package.json index 6c5b85176b..5f92f83865 100644 --- a/tests/affine-cloud/copilot/package.json +++ b/tests/affine-cloud-copilot/package.json @@ -3,7 +3,7 @@ "private": true, "type": "module", "scripts": { - "test:e2e": "yarn playwright test" + "e2e": "yarn playwright test" }, "devDependencies": { "@affine-test/kit": "workspace:*", diff --git a/tests/affine-cloud/copilot/playwright.config.ts b/tests/affine-cloud-copilot/playwright.config.ts similarity index 100% rename from tests/affine-cloud/copilot/playwright.config.ts rename to tests/affine-cloud-copilot/playwright.config.ts diff --git a/tests/affine-cloud/cloud/tsconfig.json b/tests/affine-cloud-copilot/tsconfig.json similarity index 100% rename from tests/affine-cloud/cloud/tsconfig.json rename to tests/affine-cloud-copilot/tsconfig.json diff --git a/tests/affine-cloud/cloud/e2e/collaboration.spec.ts b/tests/affine-cloud/e2e/collaboration.spec.ts similarity index 100% rename from tests/affine-cloud/cloud/e2e/collaboration.spec.ts rename to tests/affine-cloud/e2e/collaboration.spec.ts diff --git a/tests/affine-cloud/cloud/e2e/fixtures/0.9.0-canary.9-snapshots.sql b/tests/affine-cloud/e2e/fixtures/0.9.0-canary.9-snapshots.sql similarity index 100% rename from tests/affine-cloud/cloud/e2e/fixtures/0.9.0-canary.9-snapshots.sql rename to tests/affine-cloud/e2e/fixtures/0.9.0-canary.9-snapshots.sql diff --git a/tests/affine-cloud/cloud/e2e/login.spec.ts b/tests/affine-cloud/e2e/login.spec.ts similarity index 100% rename from tests/affine-cloud/cloud/e2e/login.spec.ts rename to tests/affine-cloud/e2e/login.spec.ts diff --git a/tests/affine-cloud/cloud/e2e/logo.svg b/tests/affine-cloud/e2e/logo.svg similarity index 100% rename from tests/affine-cloud/cloud/e2e/logo.svg rename to tests/affine-cloud/e2e/logo.svg diff --git a/tests/affine-cloud/cloud/e2e/migration.spec.ts b/tests/affine-cloud/e2e/migration.spec.ts similarity index 100% rename from tests/affine-cloud/cloud/e2e/migration.spec.ts rename to tests/affine-cloud/e2e/migration.spec.ts diff --git a/tests/affine-cloud/cloud/e2e/open-in-app.spec.ts b/tests/affine-cloud/e2e/open-in-app.spec.ts similarity index 100% rename from tests/affine-cloud/cloud/e2e/open-in-app.spec.ts rename to tests/affine-cloud/e2e/open-in-app.spec.ts diff --git a/tests/affine-cloud/cloud/e2e/page-history.spec.ts b/tests/affine-cloud/e2e/page-history.spec.ts similarity index 100% rename from tests/affine-cloud/cloud/e2e/page-history.spec.ts rename to tests/affine-cloud/e2e/page-history.spec.ts diff --git a/tests/affine-cloud/cloud/e2e/share-page.spec.ts b/tests/affine-cloud/e2e/share-page.spec.ts similarity index 100% rename from tests/affine-cloud/cloud/e2e/share-page.spec.ts rename to tests/affine-cloud/e2e/share-page.spec.ts diff --git a/tests/affine-cloud/cloud/e2e/template.spec.ts b/tests/affine-cloud/e2e/template.spec.ts similarity index 100% rename from tests/affine-cloud/cloud/e2e/template.spec.ts rename to tests/affine-cloud/e2e/template.spec.ts diff --git a/tests/affine-cloud/cloud/e2e/workspace.spec.ts b/tests/affine-cloud/e2e/workspace.spec.ts similarity index 100% rename from tests/affine-cloud/cloud/e2e/workspace.spec.ts rename to tests/affine-cloud/e2e/workspace.spec.ts diff --git a/tests/affine-cloud/cloud/package.json b/tests/affine-cloud/package.json similarity index 100% rename from tests/affine-cloud/cloud/package.json rename to tests/affine-cloud/package.json diff --git a/tests/affine-cloud/cloud/playwright.config.ts b/tests/affine-cloud/playwright.config.ts similarity index 100% rename from tests/affine-cloud/cloud/playwright.config.ts rename to tests/affine-cloud/playwright.config.ts diff --git a/tests/affine-cloud/copilot/tsconfig.json b/tests/affine-cloud/tsconfig.json similarity index 100% rename from tests/affine-cloud/copilot/tsconfig.json rename to tests/affine-cloud/tsconfig.json diff --git a/yarn.lock b/yarn.lock index 6e14a35285..7ec9924902 100644 --- a/yarn.lock +++ b/yarn.lock @@ -19,18 +19,18 @@ __metadata: languageName: node linkType: hard -"@affine-test/affine-cloud-copilot@workspace:tests/affine-cloud/copilot": +"@affine-test/affine-cloud-copilot@workspace:tests/affine-cloud-copilot": version: 0.0.0-use.local - resolution: "@affine-test/affine-cloud-copilot@workspace:tests/affine-cloud/copilot" + resolution: "@affine-test/affine-cloud-copilot@workspace:tests/affine-cloud-copilot" dependencies: "@affine-test/kit": "workspace:*" "@playwright/test": "npm:=1.49.1" languageName: unknown linkType: soft -"@affine-test/affine-cloud@workspace:tests/affine-cloud/cloud": +"@affine-test/affine-cloud@workspace:tests/affine-cloud": version: 0.0.0-use.local - resolution: "@affine-test/affine-cloud@workspace:tests/affine-cloud/cloud" + resolution: "@affine-test/affine-cloud@workspace:tests/affine-cloud" dependencies: "@affine-test/kit": "workspace:*" "@playwright/test": "npm:=1.49.1"