testaro 2.2.3 → 2.2.6
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/index.js +7 -6
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -220,8 +220,9 @@ const isValidLog = log => Array.isArray(log) && ! log.length;
|
|
|
220
220
|
// Validates an options object.
|
|
221
221
|
const isValidOptions = async options => {
|
|
222
222
|
if (options) {
|
|
223
|
-
const {script, batch, log, reports} = options;
|
|
224
|
-
return
|
|
223
|
+
const {id, script, batch, log, reports} = options;
|
|
224
|
+
return id
|
|
225
|
+
&& isValidScript(script)
|
|
225
226
|
&& isValidBatch(batch)
|
|
226
227
|
&& isValidLog(log)
|
|
227
228
|
&& isValidReports(reports);
|
|
@@ -1130,13 +1131,11 @@ const doBatch = async (options, reportTemplate, hostIndex = 0) => {
|
|
|
1130
1131
|
act.what = host.what;
|
|
1131
1132
|
}
|
|
1132
1133
|
});
|
|
1133
|
-
// Perform the commands on the host.
|
|
1134
|
-
await doScript(options, hostReport);
|
|
1135
1134
|
// Add the host’s ID to the host report.
|
|
1136
1135
|
hostReport.hostName = host.id;
|
|
1137
1136
|
// Add data from the template to the host report.
|
|
1138
1137
|
hostReport.orderName = reportTemplate.id;
|
|
1139
|
-
hostReport.id = `${
|
|
1138
|
+
hostReport.id = `${options.id}-${host.id}`;
|
|
1140
1139
|
hostReport.orderUserName = reportTemplate.userName;
|
|
1141
1140
|
hostReport.orderTime = reportTemplate.orderTime;
|
|
1142
1141
|
hostReport.scriptName = reportTemplate.scriptName;
|
|
@@ -1144,6 +1143,8 @@ const doBatch = async (options, reportTemplate, hostIndex = 0) => {
|
|
|
1144
1143
|
hostReport.scriptIsValid = reportTemplate.scriptIsValid;
|
|
1145
1144
|
hostReport.batchIsValid = reportTemplate.batchIsValid;
|
|
1146
1145
|
hostReport.host = host;
|
|
1146
|
+
// Perform the commands on the host and add a report to the options object.
|
|
1147
|
+
await doScript(options, hostReport);
|
|
1147
1148
|
// Process the remaining hosts.
|
|
1148
1149
|
await doBatch(options, reportTemplate, hostIndex + 1);
|
|
1149
1150
|
}
|
|
@@ -1210,7 +1211,7 @@ exports.handleRequest = async options => {
|
|
|
1210
1211
|
},
|
|
1211
1212
|
{
|
|
1212
1213
|
event: 'timeStamp',
|
|
1213
|
-
value: Math.floor((Date.now() - Date.UTC(2022, 1)) /
|
|
1214
|
+
value: Math.floor((Date.now() - Date.UTC(2022, 1)) / 500).toString(36)
|
|
1214
1215
|
}
|
|
1215
1216
|
);
|
|
1216
1217
|
// Add the batch size to the log if there is a batch.
|