-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathparsePR.js
29 lines (21 loc) · 805 Bytes
/
parsePR.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
const fs = require('fs');
const readline = require('readline')
async function extractTests(){
//by default we specify that all tests should run
let testsFile = __dirname+'/testsToRun.txt';
await fs.promises.writeFile(testsFile,'all');
const lines = readline.createInterface({
input: fs.createReadStream(__dirname+'/pr_body.txt'),
crlfDelay: Infinity
});
for await (const line of lines) {
let upperLine = line.toUpperCase();
//special delimeter for apex tests
if(upperLine.includes('APEX::[') && upperLine.includes(']::APEX')){
let tests = line.substring(8,line.length-7);
await fs.promises.writeFile(testsFile,tests);
await fs.promises.appendFile(testsFile,'\n');
}
}
}
extractTests();