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:
gpt-engineer-app[bot]
2025-11-10 18:20:22 +00:00
parent 2d65f13b85
commit c5d40d07df
14 changed files with 233 additions and 129 deletions

View File

@@ -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;