feat: Integrate TestDataTracker into all test suites

This commit is contained in:
gpt-engineer-app[bot]
2025-10-30 15:08:33 +00:00
parent 6a30a9e568
commit 1874b6ffbd
5 changed files with 80 additions and 38 deletions

View File

@@ -6,6 +6,7 @@
import { supabase } from '@/integrations/supabase/client';
import type { TestSuite, TestResult } from '../testRunner';
import { TestDataTracker } from '../TestDataTracker';
export const performanceTestSuite: TestSuite = {
id: 'performance',
@@ -107,6 +108,7 @@ export const performanceTestSuite: TestSuite = {
description: 'Measures performance of version history queries',
run: async (): Promise<TestResult> => {
const startTime = Date.now();
const tracker = new TestDataTracker();
let parkId: string | null = null;
try {
@@ -118,13 +120,15 @@ export const performanceTestSuite: TestSuite = {
name: 'Test Park Performance',
slug: parkSlug,
park_type: 'theme_park',
status: 'operating'
status: 'operating',
is_test_data: true
})
.select('id')
.single();
if (parkError) throw parkError;
parkId = park.id;
tracker.track('parks', parkId);
// Create multiple versions (updates)
for (let i = 0; i < 10; i++) {
@@ -182,8 +186,10 @@ export const performanceTestSuite: TestSuite = {
timestamp: new Date().toISOString()
};
} finally {
if (parkId) {
await supabase.from('parks').delete().eq('id', parkId);
await tracker.cleanup();
const remaining = await tracker.verifyCleanup();
if (remaining.length > 0) {
console.warn('perf-002 cleanup incomplete:', remaining);
}
}
}