This repository has been archived by the owner on Dec 1, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfailed-test.js
executable file
·67 lines (62 loc) · 1.69 KB
/
failed-test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
"use strict";
/***************************************************************************
*
* (C) Copyright IBM Corp. 2018
*
* This program and the accompanying materials are made available
* under the terms of the Apache License v2.0 which accompanies
* this distribution.
*
* The Apache License v2.0 is available at
* http://www.opensource.org/licenses/apache2.0.php
*
* Contributors:
* Multiple authors (IBM Corp.) - initial implementation and documentation
***************************************************************************/
const request = require("request-promise");
const HOST = process.env.HOST;
function getModuleVersionTests(){
return request.get({
uri: `http://${HOST}/api/ModuleVersionTests`,
followAllRedirects: true,
headers: {
"filter": JSON.stringify({
"include": [
{"ModuleVersion":"Module"},
"Architecture",
"Distribution",
"OperatingSystem",
"NodeVersion"
],
"where": {
"passed": "false"
}
})
},
json: true
}, (err, res, body) => {
if (err || res.statusCode !== 200) {
console.error(body.error);
process.exit(1);
}
return body;
});
}
async function findFailedTests () {
let mvts = await getModuleVersionTests();
let params = [];
for (let mvt of mvts) {
if (mvt.ModuleVersion && mvt.ModuleVersion.Module) {
params.push([
mvt.ModuleVersion.Module.name,
mvt.ModuleVersion.module_version,
mvt.NodeVersion.node_version,
mvt.OperatingSystem.os,
mvt.Architecture.arch,
mvt.Distribution.distro
]);
}
}
console.log(params.join("%"));
}
findFailedTests();