testilo 6.1.0 → 6.1.2

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.
Files changed (3) hide show
  1. package/aim.js +0 -4
  2. package/call.js +5 -2
  3. package/package.json +1 -1
package/aim.js CHANGED
@@ -16,8 +16,6 @@ const scriptDir = process.env.SCRIPTDIR || 'scripts';
16
16
 
17
17
  // ########## FUNCTIONS
18
18
 
19
- // Returns a string representing the date and time.
20
- const nowString = () => (new Date()).toISOString().slice(0, 19);
21
19
  // Returns a script, aimed at a host.
22
20
  exports.aim = async (scriptName, host, requester) => {
23
21
  // Copy the script.
@@ -41,8 +39,6 @@ exports.aim = async (scriptName, host, requester) => {
41
39
  const timeStamp = Math.floor((Date.now() - Date.UTC(2022, 1)) / 2000).toString(36);
42
40
  // Change the script id property to include the time stamp and the host ID.
43
41
  script.id = `${timeStamp}-${script.id}-${host.id}`;
44
- // Add the job-creation time to the script.
45
- script.jobCreationTime = nowString();
46
42
  // Return the host-specific script.
47
43
  return script;
48
44
  };
package/call.js CHANGED
@@ -20,6 +20,7 @@
20
20
  // Module to keep secrets.
21
21
  require('dotenv').config();
22
22
  // Function to process a script aiming.
23
+ const fs = require('fs/promises');
23
24
  const {aim} = require('./aim');
24
25
  // Function to process a script-batch merger.
25
26
  const {merge} = require('./merge');
@@ -43,7 +44,7 @@ const fnArgs = process.argv.slice(3);
43
44
 
44
45
  // Fulfills an aiming request.
45
46
  const callAim = async (scriptName, hostURL, hostName, hostID, notifyee) => {
46
- await aim(
47
+ const aimedScript = await aim(
47
48
  scriptName,
48
49
  {
49
50
  id: hostID,
@@ -52,7 +53,9 @@ const callAim = async (scriptName, hostURL, hostName, hostID, notifyee) => {
52
53
  },
53
54
  notifyee
54
55
  );
55
- console.log(`Script ${scriptID}.json has been aimed at ${hostName}`);
56
+ const aimedScriptID = aimedScript.id;
57
+ await fs.writeFile(`${jobDir}/${aimedScriptID}.json`, JSON.stringify(aimedScript, null, 2));
58
+ console.log(`Script ${aimedScriptID}.json has been aimed at ${hostName} and saved in ${jobDir}`);
56
59
  };
57
60
  // Fulfills a merger request.
58
61
  const callMerge = async (scriptName, batchName) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testilo",
3
- "version": "6.1.0",
3
+ "version": "6.1.2",
4
4
  "description": "Client that scores and digests Testaro reports",
5
5
  "main": "aim.js",
6
6
  "scripts": {