tewip-ai 0.18.0 → 0.18.1
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/engine/import/junit.js +21 -1
- package/package.json +1 -1
|
@@ -193,6 +193,26 @@ export function junitFiles(path) {
|
|
|
193
193
|
* Playwright; every test, passing or failing, is counted in the run summary so its history
|
|
194
194
|
* shows the passes too.
|
|
195
195
|
*/
|
|
196
|
+
/**
|
|
197
|
+
* A runner's own timestamp, when it is one a machine can read.
|
|
198
|
+
*
|
|
199
|
+
* Maven Surefire writes `timestamp="2025-03-05T11:53:11 IST"` - a timezone abbreviation with no
|
|
200
|
+
* offset, which is not a date any parser accepts. `new Date(...).toISOString()` then threw, and
|
|
201
|
+
* Tewip died on one of the most widely used test runners there is. This was found by reading real
|
|
202
|
+
* Surefire reports from public repositories; every fixture collected for this project had a clean
|
|
203
|
+
* timestamp. A report Tewip cannot date is still a report worth reading, so an unreadable one falls
|
|
204
|
+
* back to the time of import rather than stopping everything.
|
|
205
|
+
*/
|
|
206
|
+
function readTimestamp(raw) {
|
|
207
|
+
if (!raw)
|
|
208
|
+
return null;
|
|
209
|
+
const asIs = new Date(raw);
|
|
210
|
+
if (!Number.isNaN(asIs.getTime()))
|
|
211
|
+
return asIs.toISOString();
|
|
212
|
+
// Drop a trailing zone abbreviation (IST, CEST, PDT...) and read the rest as local time.
|
|
213
|
+
const withoutZone = new Date(raw.replace(/\s+[A-Z]{2,5}$/, ''));
|
|
214
|
+
return Number.isNaN(withoutZone.getTime()) ? null : withoutZone.toISOString();
|
|
215
|
+
}
|
|
196
216
|
export function importJunit(path, meta) {
|
|
197
217
|
const records = [];
|
|
198
218
|
const attempts = {};
|
|
@@ -288,7 +308,7 @@ export function importJunit(path, meta) {
|
|
|
288
308
|
runId: meta.runId,
|
|
289
309
|
gitSha: meta.gitSha,
|
|
290
310
|
...(meta.branch ? { branch: meta.branch } : {}),
|
|
291
|
-
startedAt:
|
|
311
|
+
startedAt: readTimestamp(startedAt) ?? now,
|
|
292
312
|
finishedAt: now,
|
|
293
313
|
status: anyFailed ? 'failed' : 'passed',
|
|
294
314
|
attempts,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tewip-ai",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.1",
|
|
4
4
|
"description": "Tewip finds why each failing test failed - real bug, flaky test, environment, test data or changed selector - for any stack, from the command line, CI, or your editor.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"test-failures",
|