testilo 19.0.1 → 19.0.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 CHANGED
@@ -362,10 +362,10 @@ A module can invoke `merge` in this way:
362
362
 
363
363
  ```javaScript
364
364
  const {merge} = require('testilo/merge');
365
- const jobs = merge(script, batch, requester, 'only', false, true);
365
+ const jobs = merge(script, batch, requester, true, 'only', false);
366
366
  ```
367
367
 
368
- This invocation references `script`, `batch`, and `requester` variables that the module must have already defined. The `script` and `batch` variables are a script object and a batch object, respectively. The `requester` variable is an email address. The fourth argument is a string that specifies the Testaro standardization option ('also', 'only', or 'no'). The fifth argument is a boolean, specifying whether Testaro will allow granular network watching of the job. The sixth argument is a boolean, specifying whether to perform test isolation; a missing sixth argument is equivalent to `false`. The `merge()` function of the `merge` module generates jobs and returns them in an array. The invoking module can further dispose of the jobs as needed.
368
+ This invocation references `script`, `batch`, and `requester` variables that the module must have already defined. The `script` and `batch` variables are a script object and a batch object, respectively. The `requester` variable is an email address. The fourth argument is a boolean, specifying whether to perform test isolation. The fifth argument is a string that specifies the Testaro standardization option ('also', 'only', or 'no'). The sixth argument is a boolean, specifying whether Testaro will allow granular network watching of the job. The `merge()` function of the `merge` module generates jobs and returns them in an array. The invoking module can further dispose of the jobs as needed.
369
369
 
370
370
  ##### By a user
371
371
 
@@ -374,15 +374,15 @@ A user can invoke `merge` in this way:
374
374
  - Create a script and save it as a JSON file in the `scripts` subdirectory of the `process.env.SPECDIR` directory.
375
375
  - Create a batch and save it as a JSON file in the `batches` subdirectory of the `process.env.SPECDIR` directory.
376
376
  - In the Testilo project directory, execute this statement:
377
- - `node call merge s b e o g i t`
377
+ - `node call merge s b e i f g t`
378
378
 
379
379
  In these statements, replace:
380
380
  - `s` with the base name of the script file
381
381
  - `b` with the base name of the batch file
382
382
  - `e` with an email address, or with an empty string if the environment variable `process.env.REQUESTER` exists and you want to use it
383
- - `o` with `'also'`, `'only'`, or `'no'` to specify the Testaro standardization option
384
- - `g` with `true` if you want Testaro to allow granular network watching or `false` if not.
385
383
  - `i` with `true` if you want test isolation or `false` if not
384
+ - `f` with `'also'`, `'only'`, or `'no'` to specify the treatment of standard-format results.
385
+ - `g` with `true` if reporting is to be granular, or `false` if not.
386
386
  - `t` with `true` if the job is to be saved in the `todo` subdirectory or `false` if it is to be saved in the `pending` subdirectory of the `process.env.JOBDIR` directory.
387
387
 
388
388
  The `call` module will retrieve the named script and batch from their respective directories.
package/call.js CHANGED
@@ -70,14 +70,22 @@ const callScript = async (scriptID, classificationID = null, ... issueIDs) => {
70
70
  console.log(`Script ${scriptID} created and saved in ${specDir}/scripts`);
71
71
  };
72
72
  // Fulfills a merging request.
73
- const callMerge = async (scriptID, batchID, requester, withIsolation, todo) => {
73
+ const callMerge = async (
74
+ scriptID,
75
+ batchID,
76
+ requester,
77
+ withIsolation,
78
+ standard,
79
+ isGranular,
80
+ todo
81
+ ) => {
74
82
  // Get the script and the batch.
75
83
  const scriptJSON = await fs.readFile(`${specDir}/scripts/${scriptID}.json`, 'utf8');
76
84
  const script = JSON.parse(scriptJSON);
77
85
  const batchJSON = await fs.readFile(`${specDir}/batches/${batchID}.json`, 'utf8');
78
86
  const batch = JSON.parse(batchJSON);
79
87
  // Merge them into an array of jobs.
80
- const jobs = merge(script, batch, requester, withIsolation);
88
+ const jobs = merge(script, batch, requester, withIsolation, standard, isGranular);
81
89
  // Save the jobs.
82
90
  const destination = todo === 'true' ? 'todo' : 'pending';
83
91
  for (const job of jobs) {
@@ -237,7 +245,7 @@ else if (fn === 'script' && fnArgs.length) {
237
245
  console.log('Execution completed');
238
246
  });
239
247
  }
240
- else if (fn === 'merge' && fnArgs.length === 5) {
248
+ else if (fn === 'merge' && fnArgs.length === 7) {
241
249
  callMerge(... fnArgs)
242
250
  .then(() => {
243
251
  console.log('Execution completed');
package/merge.js CHANGED
@@ -5,9 +5,9 @@
5
5
  0. script
6
6
  1. batch
7
7
  2. requester
8
- 3. value of the standard property
9
- 4. value of the granularity property
10
- 5. whether to provide test isolation (no if omitted)
8
+ 3. whether to provide test isolation
9
+ 4. value of the standard property
10
+ 5. whether reporting is to be granular
11
11
  */
12
12
 
13
13
  // ########## IMPORTS
@@ -31,7 +31,7 @@ const contaminantNames = new Set([
31
31
  // ########## FUNCTIONS
32
32
 
33
33
  // Merges a script and a batch and returns jobs.
34
- exports.merge = (script, batch, requester, standard, granular, isolate = false) => {
34
+ exports.merge = (script, batch, requester, isolate, standard, isGranular) => {
35
35
  if (isolate === 'false') {
36
36
  isolate = false;
37
37
  }
@@ -61,7 +61,7 @@ exports.merge = (script, batch, requester, standard, granular, isolate = false)
61
61
  protoJob.creationTime = creationTime;
62
62
  protoJob.timeStamp = timeStamp;
63
63
  protoJob.standard = standard || 'only';
64
- protoJob.observe = granular || false;
64
+ protoJob.observe = isGranular || false;
65
65
  // If isolation was requested:
66
66
  if (isolate) {
67
67
  // Perform it.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testilo",
3
- "version": "19.0.1",
3
+ "version": "19.0.2",
4
4
  "description": "Prepares and processes Testaro reports",
5
5
  "main": "aim.js",
6
6
  "scripts": {