testaro 8.0.5 → 8.0.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/package.json +1 -1
- package/watch.js +5 -1
package/package.json
CHANGED
package/watch.js
CHANGED
|
@@ -31,6 +31,7 @@ const checkDirJob = async () => {
|
|
|
31
31
|
const jobDirFileNames = await fs.readdir(watchDir);
|
|
32
32
|
const jobFileNames = jobDirFileNames.filter(fileName => fileName.endsWith('.json'));
|
|
33
33
|
if (jobFileNames.length) {
|
|
34
|
+
console.log('Directory job found');
|
|
34
35
|
const scriptJSON = await fs.readFile(`${watchDir}/${jobFileNames[0]}`, 'utf8');
|
|
35
36
|
try {
|
|
36
37
|
const script = JSON.parse(scriptJSON, null, 2);
|
|
@@ -44,6 +45,7 @@ const checkDirJob = async () => {
|
|
|
44
45
|
}
|
|
45
46
|
}
|
|
46
47
|
else {
|
|
48
|
+
console.log('Directory job not found');
|
|
47
49
|
return {};
|
|
48
50
|
}
|
|
49
51
|
}
|
|
@@ -78,6 +80,7 @@ const checkNetJob = async () => {
|
|
|
78
80
|
});
|
|
79
81
|
request.end();
|
|
80
82
|
});
|
|
83
|
+
console.log(`Network job ${script.id ? '' : 'not '}found`);
|
|
81
84
|
return script;
|
|
82
85
|
};
|
|
83
86
|
// Writes a directory report.
|
|
@@ -100,7 +103,7 @@ const writeDirReport = async report => {
|
|
|
100
103
|
// Submits a network report.
|
|
101
104
|
const writeNetReport = async report => {
|
|
102
105
|
const ack = await new Promise(resolve => {
|
|
103
|
-
const wholeURL = `${process.env.PROTOCOL}://${reportURL}
|
|
106
|
+
const wholeURL = `${process.env.PROTOCOL}://${reportURL}`;
|
|
104
107
|
const request = client.request(wholeURL, {method: 'POST'}, response => {
|
|
105
108
|
const chunks = [];
|
|
106
109
|
response.on('data', chunk => {
|
|
@@ -119,6 +122,7 @@ const writeNetReport = async report => {
|
|
|
119
122
|
}
|
|
120
123
|
});
|
|
121
124
|
});
|
|
125
|
+
report.agent = agent;
|
|
122
126
|
request.write(JSON.stringify(report, null, 2));
|
|
123
127
|
request.end();
|
|
124
128
|
console.log(`Report ${report.script.id} submitted`);
|