testilo 3.1.2 → 3.3.0
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 +34 -18
- package/compare.js +38 -0
- package/digest.js +19 -10
- package/package.json +1 -1
- package/procs/compare/cp0/index.html +46 -0
- package/procs/compare/cp0/index.js +70 -0
- package/procs/digest/{tsp10a → dp10a}/index.html +13 -5
- package/procs/digest/{tsp10a → dp10a}/index.js +8 -2
- package/procs/digest/{tsp09a → tdp09a}/index.html +0 -0
- package/procs/digest/{tsp09a → tdp09a}/index.js +0 -0
- package/procs/score/{tsp10a.js → sp10a.js} +4 -3
- package/reports/comparative/comparison.html +46 -0
- package/reports/comparative/style.css +89 -0
- package/reports/digested/35k1r-railpass.html +8994 -5
- package/reports/digested/style.css +4 -0
- package/reports/raw/35k1r-railpass.json +6 -1
- package/reports/scored/35k1r-railpass.json +7 -2
- package/score.js +17 -9
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "35k1r-railpass",
|
|
3
|
+
"host": {
|
|
4
|
+
"id": "railpass",
|
|
5
|
+
"which": "https://www.railpass.com/",
|
|
6
|
+
"what": "Railpass"
|
|
7
|
+
},
|
|
3
8
|
"log": [
|
|
4
9
|
{
|
|
5
10
|
"event": "startTime",
|
|
@@ -11,7 +16,7 @@
|
|
|
11
16
|
}
|
|
12
17
|
],
|
|
13
18
|
"script": {
|
|
14
|
-
"id": "
|
|
19
|
+
"id": "tp10",
|
|
15
20
|
"what": "AATT, Alfa, Axe, IBM, Tenon, WAVE, and 16 custom tests",
|
|
16
21
|
"strict": true,
|
|
17
22
|
"commands": [
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "35k1r-railpass",
|
|
3
|
+
"host": {
|
|
4
|
+
"id": "railpass",
|
|
5
|
+
"which": "https://www.railpass.com/",
|
|
6
|
+
"what": "Railpass"
|
|
7
|
+
},
|
|
3
8
|
"log": [
|
|
4
9
|
{
|
|
5
10
|
"event": "startTime",
|
|
@@ -11,7 +16,7 @@
|
|
|
11
16
|
}
|
|
12
17
|
],
|
|
13
18
|
"script": {
|
|
14
|
-
"id": "
|
|
19
|
+
"id": "tp10",
|
|
15
20
|
"what": "AATT, Alfa, Axe, IBM, Tenon, WAVE, and 16 custom tests",
|
|
16
21
|
"strict": true,
|
|
17
22
|
"commands": [
|
|
@@ -8785,7 +8790,7 @@
|
|
|
8785
8790
|
"endTime": "2022-06-03T15:25:21",
|
|
8786
8791
|
"elapsedSeconds": 99,
|
|
8787
8792
|
"score": {
|
|
8788
|
-
"scoreProcID": "
|
|
8793
|
+
"scoreProcID": "sp10a",
|
|
8789
8794
|
"duplications": {
|
|
8790
8795
|
"aatt": {
|
|
8791
8796
|
"e:F77": 1,
|
package/score.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
score.js
|
|
3
3
|
Testilo scoring script.
|
|
4
|
+
Usage example: node score 35k1r-railpass sp10a
|
|
4
5
|
*/
|
|
5
6
|
|
|
6
7
|
// ########## IMPORTS
|
|
@@ -8,26 +9,33 @@
|
|
|
8
9
|
// Module to keep secrets.
|
|
9
10
|
require('dotenv').config();
|
|
10
11
|
// Module to read and write files.
|
|
11
|
-
const fs = require('fs')
|
|
12
|
+
const fs = require('fs/promises');
|
|
12
13
|
|
|
13
14
|
// ########## CONSTANTS
|
|
14
15
|
|
|
15
16
|
const reportDirRaw = process.env.REPORTDIR_RAW || 'reports/raw';
|
|
16
17
|
const reportDirScored = process.env.REPORTDIR_SCORED || 'reports/scored';
|
|
17
|
-
const
|
|
18
|
+
const reportIDStart = process.argv[2];
|
|
18
19
|
const scoreProcID = process.argv[3];
|
|
19
20
|
|
|
20
21
|
// ########## FUNCTIONS
|
|
21
22
|
|
|
22
23
|
const score = async () => {
|
|
23
|
-
const
|
|
24
|
-
const
|
|
24
|
+
const reportDirRawAbs = `${__dirname}/${reportDirRaw}`;
|
|
25
|
+
const allReportFileNames = await fs.readdir(reportDirRawAbs);
|
|
26
|
+
const sourceReportFileNames = allReportFileNames
|
|
27
|
+
.filter(fileName => fileName.startsWith(reportIDStart) && fileName.endsWith('.json'));
|
|
25
28
|
const {scorer} = require(`./procs/score/${scoreProcID}`);
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
for (const fileName of sourceReportFileNames) {
|
|
30
|
+
const reportJSON = await fs
|
|
31
|
+
.readFile(`${reportDirRawAbs}/${fileName}`, 'utf8');
|
|
32
|
+
const report = JSON.parse(reportJSON);
|
|
33
|
+
scorer(report);
|
|
34
|
+
report.score.scoreProcID = scoreProcID;
|
|
35
|
+
const scoredReportJSON = JSON.stringify(report, null, 2);
|
|
36
|
+
await fs.writeFile(`${__dirname}/${reportDirScored}/${fileName}`, `${scoredReportJSON}\n`);
|
|
37
|
+
console.log(`Report ${fileName.slice(0, -5)} scored and saved`);
|
|
38
|
+
};
|
|
31
39
|
};
|
|
32
40
|
|
|
33
41
|
// ########## OPERATION
|