()
| 54 | } |
| 55 | |
| 56 | async function run(): Promise<void> { |
| 57 | setStatus(`Starting Tauri e2e runtime`) |
| 58 | |
| 59 | try { |
| 60 | await reportStatus(`starting`, { runId: runtimeRunId }) |
| 61 | const database = await createNativeTauriSQLiteTestDatabase({ |
| 62 | runId: runtimeRunId, |
| 63 | }) |
| 64 | await reportStatus(`database-loaded`) |
| 65 | |
| 66 | resetRegisteredTests() |
| 67 | registerTauriNativeE2ESuite({ |
| 68 | suiteName: `tauri persisted collection conformance`, |
| 69 | database, |
| 70 | runId: runtimeRunId, |
| 71 | }) |
| 72 | await reportStatus(`suite-registered`) |
| 73 | |
| 74 | const totalTests = getRegisteredTestCount() |
| 75 | setStatus(`Running Tauri e2e suite`, { |
| 76 | totalTests, |
| 77 | runId: runtimeRunId, |
| 78 | }) |
| 79 | await reportStatus(`tests-starting`, { |
| 80 | totalTests, |
| 81 | }) |
| 82 | |
| 83 | const result = await runRegisteredTests({ |
| 84 | onTestStart: ({ index, name, total }) => { |
| 85 | setStatus(`Running test ${String(index)}/${String(total)}`, { |
| 86 | currentTest: name, |
| 87 | }) |
| 88 | }, |
| 89 | }) |
| 90 | await reportStatus(`tests-finished`, { |
| 91 | total: result.total, |
| 92 | failed: result.failed, |
| 93 | }) |
| 94 | |
| 95 | const failedResults = result.results.filter( |
| 96 | (entry) => entry.status === `failed`, |
| 97 | ) |
| 98 | const summary = { |
| 99 | passed: result.passed, |
| 100 | failed: result.failed, |
| 101 | skipped: result.skipped, |
| 102 | total: result.total, |
| 103 | failures: failedResults.slice(0, 10), |
| 104 | } |
| 105 | |
| 106 | if (result.failed > 0) { |
| 107 | await reportRunResult({ |
| 108 | status: `failed`, |
| 109 | payload: summary, |
| 110 | }) |
| 111 | setStatus(`Tauri e2e failed`, summary) |
| 112 | return |
| 113 | } |
no test coverage detected