datagrok-tools 4.14.61 → 4.14.63
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/bin/utils/test-utils.js +14 -8
- package/package.json +1 -1
package/bin/utils/test-utils.js
CHANGED
|
@@ -329,16 +329,18 @@ async function runTests(testsParams, stopOnFail) {
|
|
|
329
329
|
let resultDF = undefined;
|
|
330
330
|
let lastTest = null;
|
|
331
331
|
let res = '';
|
|
332
|
-
|
|
333
|
-
// function addColumn(columnName: string, column: any, df : any) {
|
|
334
|
-
// if (!df.getCol(columnName))
|
|
335
|
-
// df.columns.add(column);
|
|
336
|
-
// }
|
|
337
|
-
|
|
338
332
|
try {
|
|
339
333
|
for (const testParam of testsParams) {
|
|
340
334
|
lastTest = testParam;
|
|
341
335
|
const df = await window.grok.functions.call(testParam.package + ':test', testParam.params);
|
|
336
|
+
if (!df.getCol('flaking')) {
|
|
337
|
+
const flakingCol = window.DG.Column.fromType(window.DG.COLUMN_TYPE.BOOL, 'flaking', df.rowCount);
|
|
338
|
+
df.columns.add(flakingCol);
|
|
339
|
+
}
|
|
340
|
+
if (!df.getCol('package')) {
|
|
341
|
+
const packageNameCol = window.DG.Column.fromList(window.DG.COLUMN_TYPE.STRING, 'package', Array(df.rowCount).fill(testParam.package));
|
|
342
|
+
df.columns.add(packageNameCol);
|
|
343
|
+
}
|
|
342
344
|
df.columns.setOrder(['date', 'category', 'name', 'success', 'result', 'ms', 'skipped', 'logs', 'owner', 'package', 'widgetsDifference', 'flaking']);
|
|
343
345
|
// addColumn('flaking', (<any>window).DG.Column.fromType((<any>window).DG.COLUMN_TYPE.BOOL, 'flaking', df.rowCount), df);
|
|
344
346
|
// addColumn('package', (<any>window).DG.Column.fromType((<any>window).DG.COLUMN_TYPE.BOOL, 'flaking', df.rowCount), df);
|
|
@@ -347,7 +349,7 @@ async function runTests(testsParams, stopOnFail) {
|
|
|
347
349
|
// df.columns.add(flakingCol);
|
|
348
350
|
// }
|
|
349
351
|
// if (!df.getCol('package')) {
|
|
350
|
-
// const packageNameCol =
|
|
352
|
+
// const packageNameCol =
|
|
351
353
|
// (<any>window).DG.Column.fromList((<any>window).DG.COLUMN_TYPE.STRING, 'package', Array(df.rowCount).fill(testParam.package));
|
|
352
354
|
// df.columns.add(packageNameCol);
|
|
353
355
|
// }
|
|
@@ -397,7 +399,9 @@ async function runTests(testsParams, stopOnFail) {
|
|
|
397
399
|
countFailed += 1;
|
|
398
400
|
failed = true;
|
|
399
401
|
}
|
|
400
|
-
if (success !== true && skipped !== true && stopOnFail)
|
|
402
|
+
if (success !== true && skipped !== true && stopOnFail) {
|
|
403
|
+
break;
|
|
404
|
+
}
|
|
401
405
|
}
|
|
402
406
|
if (window.DG.Test.isInDebug) {
|
|
403
407
|
console.log('on browser closing debug point');
|
|
@@ -418,8 +422,10 @@ async function runTests(testsParams, stopOnFail) {
|
|
|
418
422
|
}
|
|
419
423
|
} catch (e) {
|
|
420
424
|
failed = true;
|
|
425
|
+
console.log(`DEBUG: runTests: IN CATCH: ERROR: ${e}`);
|
|
421
426
|
error = lastTest ? `category: ${lastTest.params.category}, name: ${lastTest.params.test}, error: ${e}, ${await window.DG.Logger.translateStackTrace(e.stack)}` : `test: null, error: ${e}, ${await window.DG.Logger.translateStackTrace(e.stack)}`;
|
|
422
427
|
}
|
|
428
|
+
console.log(`DEBUG: runTests: BEFORE RETURN: RES: ${res.length}, FAILED: ${failed}, ERROR: ${error}`);
|
|
423
429
|
return {
|
|
424
430
|
failed: failed,
|
|
425
431
|
verbosePassed: verbosePassed,
|
package/package.json
CHANGED