mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-22 17:51:12 -05:00
Connect to Lovable Cloud
Apply quick wins and pipeline fixes for integration tests: - Remove is_test_data flag from location inserts - Increase test delay from 2.5s to 5s and add delays between suites to curb rate limiting - Replace [object Object] error formatting with formatTestError across 10 test suites (31 edits) and add import - Refactor unit/conversion tests and performance tests to use the approval pipeline - Extend edge function handling by ensuring item_ids are included in idempotency key inserts (edge function fix) - Update auth, data integrity, edgeFunction, moderation, performance, submission, unitConversion, and versioning test files accordingly
This commit is contained in:
@@ -53,9 +53,9 @@ export class IntegrationTestRunner {
|
||||
private onProgress?: (result: TestResult) => void;
|
||||
private delayBetweenTests: number;
|
||||
|
||||
constructor(onProgress?: (result: TestResult) => void, delayBetweenTests: number = 2500) {
|
||||
constructor(onProgress?: (result: TestResult) => void, delayBetweenTests: number = 5000) {
|
||||
this.onProgress = onProgress;
|
||||
this.delayBetweenTests = delayBetweenTests; // Default 2.5 seconds to prevent rate limiting
|
||||
this.delayBetweenTests = delayBetweenTests; // Default 5 seconds to prevent rate limiting
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -189,12 +189,41 @@ export class IntegrationTestRunner {
|
||||
this.isRunning = true;
|
||||
this.shouldStop = false;
|
||||
|
||||
for (const suite of suites) {
|
||||
await this.runSuite(suite);
|
||||
for (let i = 0; i < suites.length; i++) {
|
||||
await this.runSuite(suites[i]);
|
||||
|
||||
if (this.shouldStop) {
|
||||
break;
|
||||
}
|
||||
|
||||
// Add delay between suites to prevent rate limiting
|
||||
if (i < suites.length - 1 && this.delayBetweenTests > 0) {
|
||||
const delaySeconds = this.delayBetweenTests / 1000;
|
||||
const delayResult: TestResult = {
|
||||
id: `suite-delay-${Date.now()}`,
|
||||
name: `⏳ Suite completion delay: ${delaySeconds}s`,
|
||||
suite: 'System',
|
||||
status: 'running',
|
||||
duration: 0,
|
||||
timestamp: new Date().toISOString(),
|
||||
details: { reason: 'Pausing between suites to prevent rate limiting' }
|
||||
};
|
||||
|
||||
if (this.onProgress) {
|
||||
this.onProgress(delayResult);
|
||||
}
|
||||
|
||||
await this.delay(this.delayBetweenTests);
|
||||
|
||||
if (this.onProgress) {
|
||||
this.onProgress({
|
||||
...delayResult,
|
||||
status: 'skip',
|
||||
duration: this.delayBetweenTests,
|
||||
details: { reason: 'Suite delay completed' }
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.isRunning = false;
|
||||
|
||||
Reference in New Issue
Block a user