testaro 8.4.4 → 8.4.5
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/call.js +4 -2
- package/high.js +12 -5
- package/package.json +1 -1
- package/run.js +2 -0
package/call.js
CHANGED
|
@@ -29,8 +29,10 @@ const reportDir = process.env.REPORTDIR;
|
|
|
29
29
|
|
|
30
30
|
// Fulfills a high-level testing request.
|
|
31
31
|
const callHigh = async jobID => {
|
|
32
|
-
await runJob(jobID);
|
|
33
|
-
|
|
32
|
+
const done = await runJob(jobID);
|
|
33
|
+
if (done) {
|
|
34
|
+
console.log(`Job completed and report ${jobID}.json saved in ${reportDir}`);
|
|
35
|
+
}
|
|
34
36
|
};
|
|
35
37
|
// Starts a watch.
|
|
36
38
|
const callWatch = async (isDirWatch, isForever, interval) => {
|
package/high.js
CHANGED
|
@@ -41,13 +41,20 @@ exports.runJob = async jobID => {
|
|
|
41
41
|
acts: [],
|
|
42
42
|
jobData: {}
|
|
43
43
|
};
|
|
44
|
-
//
|
|
45
|
-
await doJob(report);
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
// If the initialized report is valid, run the job, adding the results to the report.
|
|
45
|
+
const done = await doJob(report);
|
|
46
|
+
if (done) {
|
|
47
|
+
const reportJSON = JSON.stringify(report, null, 2);
|
|
48
|
+
await fs.writeFile(`${reportDir}/${jobID}.json`, reportJSON);
|
|
49
|
+
console.log(`Report ${jobID}.json recorded in ${process.env.REPORTDIR}`);
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
49
55
|
}
|
|
50
56
|
catch(error) {
|
|
51
57
|
console.log(`ERROR running job (${error.message})\n${error.stack}`);
|
|
58
|
+
return false;
|
|
52
59
|
}
|
|
53
60
|
};
|
package/package.json
CHANGED
package/run.js
CHANGED
|
@@ -1560,8 +1560,10 @@ exports.doJob = async report => {
|
|
|
1560
1560
|
const endTime = new Date();
|
|
1561
1561
|
report.jobData.endTime = nowString();
|
|
1562
1562
|
report.jobData.elapsedSeconds = Math.floor((endTime - startTime) / 1000);
|
|
1563
|
+
return true;
|
|
1563
1564
|
}
|
|
1564
1565
|
else {
|
|
1565
1566
|
console.log('ERROR: Initialized job report invalid');
|
|
1567
|
+
return false;
|
|
1566
1568
|
}
|
|
1567
1569
|
};
|