testaro 75.2.1 → 75.2.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.
- package/README.md +1 -1
- package/netWatch.js +15 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -258,7 +258,7 @@ In both cases, the first argument of `dirWatch` tells Testaro whether to continu
|
|
|
258
258
|
|
|
259
259
|
Testaro can poll a server for jobs to be performed. The server can act as the “controller” described in [How to run a thousand accessibility tests](https://medium.com/cvs-health-tech-blog/how-to-run-a-thousand-accessibility-tests-63692ad120c3). The server is responsible for preparing Testaro jobs, assigning them to Testaro agents, receiving reports back from those agents, and performing any further processing of the reports, including enhancement, storage, and disclosure to audiences. It can be any server reachable with a URL. That includes a server running on the same host as Testaro, with a URL such as `localhost:3000`.
|
|
260
260
|
|
|
261
|
-
To
|
|
261
|
+
To allow Testaro to poll a server for jobs, define the following environment variables:
|
|
262
262
|
|
|
263
263
|
- `NETWATCH_URL_JOB`: which URL to poll (the URL must contain the value of the `AGENT` environment variable)
|
|
264
264
|
- `NETWATCH_URL_REPORT`: which URL to send job reports to
|
package/netWatch.js
CHANGED
|
@@ -29,10 +29,21 @@ const {nowString} = require('./procs/dateTime');
|
|
|
29
29
|
|
|
30
30
|
// CONSTANTS
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
const
|
|
32
|
+
// The netWatch environment variables are required only for network watching,
|
|
33
|
+
// but call.js loads this module for every command, so their absence or
|
|
34
|
+
// invalidity must not throw here; netWatch reports it if netWatch is used.
|
|
35
|
+
const toURL = urlString => {
|
|
36
|
+
try {
|
|
37
|
+
return new URL(urlString);
|
|
38
|
+
}
|
|
39
|
+
catch(error) {
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
const jobURL = toURL(process.env.NETWATCH_URL_JOB);
|
|
44
|
+
const jobHost = jobURL && jobURL.host;
|
|
45
|
+
const reportURL = toURL(process.env.NETWATCH_URL_REPORT);
|
|
46
|
+
const reportHost = reportURL && reportURL.host;
|
|
36
47
|
const agentPW = process.env.NETWATCH_URL_AUTH;
|
|
37
48
|
|
|
38
49
|
// FUNCTIONS
|