Compare commits

...

18 Commits

Author SHA1 Message Date
Alessio Gravili
8c7d8fcb65 ignore4 2024-04-04 23:40:05 -04:00
Alessio Gravili
5472c88475 ignore3 2024-04-04 23:32:25 -04:00
Alessio Gravili
74e15566eb ignore2 2024-04-04 23:16:04 -04:00
Alessio Gravili
39f2d7ad30 ignore 2024-04-04 22:42:51 -04:00
Alessio Gravili
7af12dadc9 ignore! 2024-04-04 22:36:54 -04:00
Alessio Gravili
70ddd2ddc6 ignore 2024-04-04 22:35:39 -04:00
Alessio Gravili
63076af946 ignore 2024-04-04 22:29:06 -04:00
Alessio Gravili
55b31378aa idk what im doing 2024-04-04 21:08:51 -04:00
Alessio Gravili
40f734303b Merge branch 'ci/experiments' of https://github.com/payloadcms/payload into ci/experiments 2024-04-04 19:10:31 -04:00
Alessio Gravili
aa53fdaede run again 2024-04-04 19:10:05 -04:00
Alessio Gravili
37077f42de Merge branch 'alpha' into ci/experiments 2024-04-04 18:55:33 -04:00
Alessio Gravili
fd9b20ff31 run again 2024-04-04 18:30:30 -04:00
Alessio Gravili
dc3bba0477 Merge branch 'alpha' into ci/experiments 2024-04-04 18:13:30 -04:00
Alessio Gravili
31f7d98e58 run again 2024-04-04 18:06:00 -04:00
Alessio Gravili
92f2ad7c15 run again 2024-04-04 16:32:47 -04:00
Alessio Gravili
73c76daef2 run again 2024-04-04 16:31:17 -04:00
Alessio Gravili
1b2241f02d chore: intentionally fail test 2024-04-04 16:27:51 -04:00
Alessio Gravili
12f34cab16 test 2024-04-04 16:23:43 -04:00
2 changed files with 36 additions and 237 deletions

View File

@@ -79,187 +79,15 @@ jobs:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
plugins-build:
needs: changes
if: ${{ needs.changes.outputs.needs_build == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 25
- name: Use Node.js 18
uses: actions/setup-node@v4
with:
node-version: 18
- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: 8
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
- run: pnpm install
- run: pnpm run build:plugins
tests-unit:
runs-on: ubuntu-latest
needs: core-build
if: false # Disable until tests are updated for 3.0
steps:
- name: Use Node.js 18
uses: actions/setup-node@v4
with:
node-version: 18
- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: 8
run_install: false
- name: Restore build
uses: actions/cache@v4
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
- name: Unit Tests
run: pnpm test:unit
env:
NODE_OPTIONS: --max-old-space-size=8096
tests-int:
runs-on: ubuntu-latest
needs: core-build
strategy:
fail-fast: false
matrix:
database:
- mongodb
- postgres
# - postgres-custom-schema
# - postgres-uuid
# - supabase
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: payloadtests
AWS_ENDPOINT_URL: http://127.0.0.1:4566
AWS_ACCESS_KEY_ID: localstack
AWS_SECRET_ACCESS_KEY: localstack
AWS_REGION: us-east-1
steps:
- name: Use Node.js 18
uses: actions/setup-node@v4
with:
node-version: 18
- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: 8
run_install: false
- name: Restore build
uses: actions/cache@v4
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
- name: Start LocalStack
run: pnpm docker:start
- name: Start PostgreSQL
uses: CasperWA/postgresql-action@v1.2
with:
postgresql version: '14' # See https://hub.docker.com/_/postgres for available versions
postgresql db: ${{ env.POSTGRES_DB }}
postgresql user: ${{ env.POSTGRES_USER }}
postgresql password: ${{ env.POSTGRES_PASSWORD }}
if: startsWith(matrix.database, 'postgres')
- name: Install Supabase CLI
uses: supabase/setup-cli@v1
with:
version: latest
if: matrix.database == 'supabase'
- name: Initialize Supabase
run: |
supabase init
supabase start
if: matrix.database == 'supabase'
- name: Wait for PostgreSQL
run: sleep 30
if: startsWith(matrix.database, 'postgres')
- name: Configure PostgreSQL
run: |
psql "postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@localhost:5432/$POSTGRES_DB" -c "CREATE ROLE runner SUPERUSER LOGIN;"
psql "postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@localhost:5432/$POSTGRES_DB" -c "SELECT version();"
echo "POSTGRES_URL=postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@localhost:5432/$POSTGRES_DB" >> $GITHUB_ENV
if: startsWith(matrix.database, 'postgres')
- name: Configure PostgreSQL with custom schema
run: |
psql "postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@localhost:5432/$POSTGRES_DB" -c "CREATE SCHEMA custom;"
if: matrix.database == 'postgres-custom-schema'
- name: Configure Supabase
run: |
echo "POSTGRES_URL=postgresql://postgres:postgres@127.0.0.1:54322/postgres" >> $GITHUB_ENV
if: matrix.database == 'supabase'
- name: Integration Tests
run: pnpm test:int
env:
NODE_OPTIONS: --max-old-space-size=8096
PAYLOAD_DATABASE: ${{ matrix.database }}
POSTGRES_URL: ${{ env.POSTGRES_URL }}
tests-e2e:
runs-on: ubuntu-latest
needs: core-build
strategy:
fail-fast: false
matrix:
# find test -type f -name 'e2e.spec.ts' | sort | xargs dirname | xargs -I {} basename {}
suite:
- _community
- access-control
# - admin
- auth
- field-error-states
- fields-relationship
# - fields
- fields/lexical
- live-preview
- localization
- plugin-form-builder
- plugin-nested-docs
- plugin-seo
- versions
- uploads
# Add other suites as needed
steps:
- name: Use Node.js 18
uses: actions/setup-node@v4
@@ -291,63 +119,38 @@ jobs:
path: test/test-results/
retention-days: 1
tests-type-generation:
if: false # This should be replaced with gen on a real Payload project
runs-on: ubuntu-latest
needs: core-build
steps:
- name: Use Node.js 18
uses: actions/setup-node@v4
with:
node-version: 18
- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: 8
run_install: false
- name: Restore build
uses: actions/cache@v4
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
- name: Generate Payload Types
run: pnpm dev:generate-types fields
- name: Generate GraphQL schema file
run: pnpm dev:generate-graphql-schema graphql-schema-gen
templates:
needs: changes
if: false # Disable until templates are updated for 3.0
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
template: [blank, website, ecommerce]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 25
- name: Use Node.js 18
uses: actions/setup-node@v4
with:
node-version: 18
- name: Start MongoDB
uses: supercharge/mongodb-github-action@1.10.0
with:
mongodb-version: 6.0
- name: Build Template
- name: Process and Upload Trace Files
if: always()
run: |
cd templates/${{ matrix.template }}
cp .env.example .env
yarn install
yarn build
yarn generate:types
count=0
for folder in test/test-results/*; do
if [ -d "$folder" ] && [ -f "$folder/trace.zip" ]; then
((count++))
if [ "$count" -le 5 ]; then
test_name=$(basename "$folder")
echo "Processing $test_name"
new_trace_name="trace-${{ matrix.suite }}-$count.zip"
cp "$folder/trace.zip" "$new_trace_name"
echo "$test_name: $new_trace_name" >> map.txt
else
break
fi
fi
done
cat map.txt
shell: bash
- uses: actions/upload-artifact@v4
with:
name: trace-${{ matrix.suite }}-1
path: trace-${{ matrix.suite }}-1.zip
- name: Display Mapped Names and Links
run: |
while IFS= read -r line; do
IFS=': ' read -r test_name trace_name <<< "$line"
echo "${test_name}: https://github.com/payloadcms/payload/actions/runs/${GITHUB_RUN_ID}/artifacts/${trace_name}"
done < map.txt
shell: bash

View File

@@ -22,13 +22,9 @@ test.describe('Admin Panel', () => {
const context = await browser.newContext()
page = await context.newPage()
initPageConsoleErrorCatch(page)
await ensureAutoLoginAndCompilationIsDone({ page, serverURL })
})
test('example test', async () => {
await page.goto(url.list)
const textCell = page.locator('.row-1 .cell-text')
await expect(textCell).toHaveText('example post')
await expect(true).toBe(false)
})
})