@dionlarson/playwright-orchestrator-mysql 1.3.9 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/mysql-adapter.d.ts +1 -0
- package/dist/mysql-adapter.js +11 -0
- package/package.json +1 -1
package/dist/mysql-adapter.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export declare class MySQLAdapter extends Adapter {
|
|
|
17
17
|
startShard(runId: string): Promise<TestRunConfig>;
|
|
18
18
|
finishShard(runId: string): Promise<void>;
|
|
19
19
|
dispose(): Promise<void>;
|
|
20
|
+
cleanupStaleTests(runId: string, staleMinutes: number): Promise<number>;
|
|
20
21
|
getReportData(runId: string): Promise<TestRunReport>;
|
|
21
22
|
private loadTestInfos;
|
|
22
23
|
private updateTestWithResult;
|
package/dist/mysql-adapter.js
CHANGED
|
@@ -208,6 +208,17 @@ export class MySQLAdapter extends Adapter {
|
|
|
208
208
|
async dispose() {
|
|
209
209
|
await this.pool.end();
|
|
210
210
|
}
|
|
211
|
+
async cleanupStaleTests(runId, staleMinutes) {
|
|
212
|
+
const [result] = await this.pool.query({
|
|
213
|
+
sql: `UPDATE ??
|
|
214
|
+
SET status = ?, updated = CURRENT_TIMESTAMP
|
|
215
|
+
WHERE run_id = UUID_TO_BIN(?)
|
|
216
|
+
AND status = ?
|
|
217
|
+
AND updated < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL ? MINUTE)`,
|
|
218
|
+
values: [this.testsTable, TestStatus.Ready, runId, TestStatus.Ongoing, staleMinutes],
|
|
219
|
+
});
|
|
220
|
+
return result.affectedRows;
|
|
221
|
+
}
|
|
211
222
|
async getReportData(runId) {
|
|
212
223
|
const [[run]] = await this.pool.query({
|
|
213
224
|
sql: `SELECT * FROM ??
|