-
Notifications
You must be signed in to change notification settings - Fork 435
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: move PTE e2e tests into own worker and folder
- Loading branch information
1 parent
fd7db60
commit 3bd4884
Showing
30 changed files
with
99 additions
and
47 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 |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: End-to-End PTE collaboration tests | ||
on: | ||
# Build on pushes branches that have a PR (including drafts) | ||
pull_request: | ||
# Build on commits pushed to branches without a PR if it's in the allowlist | ||
push: | ||
branches: [next] | ||
jobs: | ||
playwright-test: | ||
timeout-minutes: 30 | ||
runs-on: ubuntu-latest | ||
env: | ||
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} | ||
TURBO_TEAM: ${{ vars.TURBO_TEAM }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
project: [chromium] | ||
# Add more shards here if needed | ||
shardIndex: [1, 2] | ||
shardTotal: [2] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18 | ||
|
||
- name: Cache node modules | ||
id: cache-node-modules | ||
uses: actions/cache@v3 | ||
env: | ||
cache-name: cache-node-modules | ||
with: | ||
path: '**/node_modules' | ||
key: ${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-modules-${{ env.cache-name }}- | ||
${{ runner.os }}-modules- | ||
${{ runner.os }}- | ||
- name: Install project dependencies | ||
if: steps.cache-node-modules.outputs.cache-hit != 'true' | ||
run: yarn install --frozen-lockfile | ||
|
||
- name: Store Playwright's Version | ||
run: | | ||
PLAYWRIGHT_VERSION=$(npx playwright --version | sed 's/Version //') | ||
echo "Playwright's Version: $PLAYWRIGHT_VERSION" | ||
echo "PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> $GITHUB_ENV | ||
- name: Cache Playwright Browsers for Playwright's Version | ||
id: cache-playwright-browsers | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.cache/ms-playwright | ||
key: playwright-browsers-${{ env.PLAYWRIGHT_VERSION }} | ||
|
||
- name: Install Playwright Browsers | ||
if: steps.cache-playwright-browsers.outputs.cache-hit != 'true' | ||
run: npx playwright install --with-deps | ||
|
||
- name: Run end-to-end tests | ||
run: cd packages/@sanity/portable-text-editor && yarn test:e2e --silent --shard=${{ matrix.shardIndex}}/${{ matrix.shardTotal }} |
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
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
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...t/__tests__/pasting.collaborative.test.ts → ...s/__tests__/pasting.collaborative.test.ts
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
2 changes: 1 addition & 1 deletion
2
...selectionAdjustment.collaborative.test.ts → ...selectionAdjustment.collaborative.test.ts
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
2 changes: 1 addition & 1 deletion
2
...t/__tests__/undoRedo.collborative.test.ts → ...s/__tests__/undoRedo.collborative.test.ts
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
2 changes: 1 addition & 1 deletion
2
...s__/writingTogether.collaborative.test.ts → ...s__/writingTogether.collaborative.test.ts
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
13 changes: 13 additions & 0 deletions
13
packages/@sanity/portable-text-editor/e2e-tests/e2e.config.cjs
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
'use strict' | ||
|
||
const {createJestConfig} = require('../../../../test/config.cjs') | ||
|
||
// eslint-disable-next-line no-console | ||
console.info('Running collaborate editing tests for the Portable Text Editor') | ||
|
||
module.exports = createJestConfig({ | ||
displayName: require('../package.json').name, | ||
globalSetup: './setup/globalSetup.ts', | ||
globalTeardown: './setup/globalTeardown.ts', | ||
setupFilesAfterEnv: ['./setup/afterEnv.ts'], | ||
}) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
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
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
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
'use strict' | ||
|
||
const Sequencer = require('@jest/test-sequencer').default | ||
|
||
module.exports = class JestShardSequencer extends Sequencer { | ||
shard(tests) { | ||
return tests.filter((test) => !test.path.includes('e2e')) | ||
} | ||
} |
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