Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 16 additions & 15 deletions playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,23 @@ export default defineConfig({
forbidOnly: !!process.env.CI,
/* 1 retry catches timing-sensitive tests without hiding consistent issues */
retries: 1,
/* Conservative approach for CI stability - 1 worker ensures each test gets full resources */
workers: isCI ? 1 : undefined,
workers: 1,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: 'list',
/* Test timeout */
timeout: isCI ? 60 * 1000 : 30 * 1000, // 60 seconds in CI, 30 locally
timeout: 60 * 1000,

expect: {
timeout: 10 * 1000,
},

/* Global setup - runs once before all tests */
globalSetup: require.resolve('./tests/global.setup.ts'),

/* Shared settings for all the projects below. */
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
baseURL: 'http://localhost:3000',

/* Collect trace when retrying the failed test. */
actionTimeout: 10 * 1000,
navigationTimeout: 30 * 1000,
trace: 'on-first-retry',

/* Screenshot on failure */
screenshot: 'only-on-failure',

/* Video on failure */
video: 'retain-on-failure',
},

Expand All @@ -50,11 +45,17 @@ export default defineConfig({
name: 'setup',
testMatch: /auth\.setup\.ts/,
},
// Data setup - creates listings, reports, etc. that other tests depend on
{
name: 'data-setup',
testMatch: /data-setup\.spec\.ts/,
dependencies: ['setup'],
},
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
testIgnore: ['**/auth.setup.ts', '**/global.setup.ts'],
dependencies: ['setup'], // Ensure auth is set up before running tests
testIgnore: ['**/auth.setup.ts', '**/global.setup.ts', '**/data-setup.spec.ts'],
dependencies: ['data-setup'],
},
],

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
-- AlterEnum
ALTER TYPE "trust_action" ADD VALUE 'VOTE_CHANGE_REVERSAL';

-- CreateIndex
CREATE INDEX "CommentVote_userId_nullifiedAt_idx" ON "CommentVote"("userId", "nullifiedAt");

-- CreateIndex
CREATE INDEX "Vote_userId_nullifiedAt_idx" ON "Vote"("userId", "nullifiedAt");

-- CreateIndex
CREATE INDEX "pc_listing_comment_votes_userId_nullifiedAt_idx" ON "pc_listing_comment_votes"("userId", "nullifiedAt");

-- CreateIndex
CREATE INDEX "pc_listing_votes_userId_nullifiedAt_idx" ON "pc_listing_votes"("userId", "nullifiedAt");
5 changes: 5 additions & 0 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,7 @@ model Vote {
@@unique([userId, listingId])
@@index([userId])
@@index([listingId])
@@index([userId, nullifiedAt])
}

model Comment {
Expand Down Expand Up @@ -541,6 +542,7 @@ model CommentVote {

@@unique([userId, commentId])
@@index([userId])
@@index([userId, nullifiedAt])
}

model ListingCustomFieldValue {
Expand Down Expand Up @@ -735,6 +737,7 @@ enum TrustAction {
ADMIN_ADJUSTMENT_POSITIVE
ADMIN_ADJUSTMENT_NEGATIVE
VOTE_NULLIFICATION_REVERSAL
VOTE_CHANGE_REVERSAL

@@map("trust_action")
}
Expand Down Expand Up @@ -1123,6 +1126,7 @@ model PcListingVote {
@@unique([userId, pcListingId])
@@index([pcListingId])
@@index([userId])
@@index([userId, nullifiedAt])
@@map("pc_listing_votes")
}

Expand Down Expand Up @@ -1166,6 +1170,7 @@ model PcListingCommentVote {
@@unique([userId, commentId])
@@index([commentId])
@@index([userId])
@@index([userId, nullifiedAt])
@@map("pc_listing_comment_votes")
}

Expand Down
3 changes: 3 additions & 0 deletions prisma/seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import customFieldTemplatesSeeder from './seeders/customFieldTemplatesSeeder'
import devicesSeeder from './seeders/devicesSeeder'
import edenCustomFieldsSeeder from './seeders/edenCustomFieldsSeeder'
import emulatorsSeeder from './seeders/emulatorsSeeder'
import gamenativeCustomFieldsSeeder from './seeders/gamenativeCustomFieldsSeeder'
import gamesSeeder from './seeders/gamesSeeder'
import gpuSeeder from './seeders/gpuSeeder'
import listingsSeeder from './seeders/listingsSeeder'
Expand Down Expand Up @@ -129,6 +130,7 @@ async function main() {
await customFieldTemplatesSeeder(prisma)
await azaharCustomFieldsSeeder(prisma)
await edenCustomFieldsSeeder(prisma)
await gamenativeCustomFieldsSeeder(prisma)
console.info('✅ Custom fields seeded successfully!')
} catch (error) {
console.error('❌ Error seeding custom fields:', error)
Expand Down Expand Up @@ -188,6 +190,7 @@ async function main() {
await emulatorsSeeder(prisma)
await azaharCustomFieldsSeeder(prisma)
await edenCustomFieldsSeeder(prisma)
await gamenativeCustomFieldsSeeder(prisma)
await customFieldTemplatesSeeder(prisma)
await socSeeder(prisma)
await cpuSeeder(prisma)
Expand Down
Loading
Loading