testilo 3.3.0 → 3.4.1

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 (36) hide show
  1. package/README.md +40 -0
  2. package/package.json +1 -1
  3. package/procs/compare/cp1/index.html +46 -0
  4. package/procs/compare/cp1/index.js +71 -0
  5. package/procs/digest/dp10a/index.html +2 -2
  6. package/procs/digest/dp10b/index.html +74 -0
  7. package/procs/digest/dp10b/index.js +130 -0
  8. package/procs/digest/dp10c/index.html +55 -0
  9. package/procs/digest/dp10c/index.js +129 -0
  10. package/procs/score/sp10b.js +507 -0
  11. package/procs/score/sp10c.js +465 -0
  12. package/reports/comparative/{comparison.html → railsites.html} +3 -2
  13. package/reports/digested/35k1r-railpass.html +1129 -843
  14. package/reports/digested/3aee6-eurail.html +36233 -0
  15. package/reports/digested/dp10a/35k1r-railpass.html +9302 -0
  16. package/reports/digested/dp10a/3aee6-eurail.html +35782 -0
  17. package/reports/digested/style.css +2 -2
  18. package/reports/raw/3aee6-eurail.json +35250 -0
  19. package/reports/scored/35k1r-railpass.json +559 -175
  20. package/reports/scored/3aee6-eurail.json +35957 -0
  21. package/score.js +1 -1
  22. package/scoring/data/duplications.json +22 -22
  23. package/scoring/data/groups.json +335 -0
  24. package/scoring/data/packageRules/alfa.tsv +82 -0
  25. package/scoring/data/packageRules/axe.js +390 -0
  26. package/scoring/data/packageRules/ibm.tsv +159 -0
  27. package/scoring/data/packageRules/tenon.tsv +14 -0
  28. package/scoring/data/packageRules/wave.json +1617 -0
  29. package/scoring/data/packageRules/wave.tsv +55 -0
  30. package/scoring/data/testGroups.json +1067 -0
  31. package/scoring/{data → procs}/correlation.js +0 -0
  32. package/scoring/{data → procs}/dupCounts.js +0 -0
  33. package/scoring/procs/groups.js +61 -0
  34. package/scoring/{data → procs}/packageData.js +0 -0
  35. package/scoring/{data → procs}/packageIssues.js +0 -0
  36. package/scoring/procs/regroup.js +39 -0
File without changes
File without changes
@@ -0,0 +1,61 @@
1
+ /*
2
+ groups
3
+ Converts duplications.json to groups.json.
4
+ */
5
+ const fs = require('fs');
6
+ // Initialize an array of groups.
7
+ const groups = [];
8
+ // Returns the group that an issue belongs to.
9
+ const getGroupIndex = (package, issueID) => {
10
+ return groups.findIndex(group => group[package] && group[package].includes(issueID));
11
+ };
12
+ // Assign an issue to a group.
13
+ const addToGroup = (package, issue, index) => {
14
+ if (groups[index][package]) {
15
+ groups[index][package].push(issue);
16
+ }
17
+ else {
18
+ groups[index][package] = [issue];
19
+ }
20
+ };
21
+ const compile = () => {
22
+ const dupsJSON = fs.readFileSync(`${__dirname}/../data/duplications.json`, 'utf8');
23
+ const dups = JSON.parse(dupsJSON);
24
+ // For each pair of packages:
25
+ const packagePairs = Object.keys(dups);
26
+ packagePairs.forEach(packagePair => {
27
+ const packages = packagePair.split('_');
28
+ // For each issue in the first package:
29
+ Object.keys(dups[packagePair]).forEach(issueA => {
30
+ const groupIndexA = getGroupIndex(packages[0], issueA);
31
+ const issueB = Object.keys(dups[packagePair][issueA])[0];
32
+ const groupIndexB = getGroupIndex(packages[1], issueB);
33
+ // If both issues belong to groups and the groups differ:
34
+ if (groupIndexA > -1 && groupIndexB > -1 && groupIndexB !== groupIndexA) {
35
+ // Report the discrepancy.
36
+ console.log(`Inspect ${packages[0]} ${issueA} and ${packages[1]} ${issueB}`);
37
+ }
38
+ // Otherwise, if only the first issue belongs to a group:
39
+ else if (groupIndexA > -1 && groupIndexB === -1) {
40
+ // Assign the second issue to that group.
41
+ addToGroup(packages[1], issueB, groupIndexA);
42
+ }
43
+ // Otherwise, if only the second issue belongs to a group:
44
+ else if (groupIndexA === -1 && groupIndexB > -1) {
45
+ // Assign the first issue to that group.
46
+ addToGroup(packages[0], issueA, groupIndexB);
47
+ }
48
+ // Otherwise, if neither issue belongs to a group:
49
+ else if (groupIndexA === -1 && groupIndexB === -1) {
50
+ // Create a group and add both issues to it.
51
+ groups.push({
52
+ [packages[0]]: [issueA],
53
+ [packages[1]]: [issueB]
54
+ });
55
+ }
56
+ });
57
+ });
58
+ return groups;
59
+ };
60
+ fs.writeFileSync(`${__dirname}/../data/groups.json`, JSON.stringify(compile(), null, 2));
61
+ console.log(`File groups.json, containing ${groups.length} groups, created`);
File without changes
File without changes
@@ -0,0 +1,39 @@
1
+ /*
2
+ regroup
3
+ Converts groups.json to testGroups.json.
4
+ */
5
+ const fs = require('fs');
6
+ // Initialize the data.
7
+ const data = {
8
+ tests: {},
9
+ groups: {}
10
+ };
11
+ const compile = () => {
12
+ // Add the groups to the data.
13
+ const groupsJSON = fs.readFileSync(`${__dirname}/../data/groups.json`, 'utf8');
14
+ const groups = JSON.parse(groupsJSON);
15
+ data.groups = groups;
16
+ // For each group:
17
+ const groupIDs = Object.keys(groups);
18
+ groupIDs.forEach(groupID => {
19
+ // Add its tests to the data.
20
+ const packageIDs = Object.keys(groups[groupID]);
21
+ packageIDs.forEach(packageID => {
22
+ const tests = groups[groupID][packageID];
23
+ tests.forEach(test => {
24
+ const testID = test.replace(/ .+/, '');
25
+ const what = test.replace(/^[^ ]+ /, '');
26
+ if (! data.tests[packageID]) {
27
+ data.tests[packageID] = {};
28
+ }
29
+ data.tests[packageID][testID] = {
30
+ groupID,
31
+ what
32
+ };
33
+ });
34
+ });
35
+ });
36
+ return data;
37
+ };
38
+ fs.writeFileSync(`${__dirname}/../data/testGroups.json`, JSON.stringify(compile(), null, 2));
39
+ console.log(`File testGroups.json created`);