testaro 2.2.4 → 2.2.7
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 +13 -12
- 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,20 +1131,20 @@ 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
|
-
hostReport.orderName =
|
|
1139
|
-
hostReport.id = `${
|
|
1140
|
-
hostReport.orderUserName =
|
|
1141
|
-
hostReport.orderTime =
|
|
1142
|
-
hostReport.scriptName =
|
|
1143
|
-
hostReport.batchName =
|
|
1144
|
-
hostReport.scriptIsValid =
|
|
1145
|
-
hostReport.batchIsValid =
|
|
1137
|
+
hostReport.orderName = options.id;
|
|
1138
|
+
hostReport.id = `${options.id}-${host.id}`;
|
|
1139
|
+
hostReport.orderUserName = options.userName;
|
|
1140
|
+
hostReport.orderTime = options.orderTime;
|
|
1141
|
+
hostReport.scriptName = options.scriptName;
|
|
1142
|
+
hostReport.batchName = options.batchName;
|
|
1143
|
+
hostReport.scriptIsValid = options.scriptIsValid;
|
|
1144
|
+
hostReport.batchIsValid = options.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
|
}
|