Skip to content

Commit 9ed42ad

Browse files
committed
Adding basic structure for sync specs logging
1 parent daea598 commit 9ed42ad

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

bin/helpers/sync/syncSpecsLogs.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
'use strict';
2+
const request = require('request'),
3+
config = require('../config'),
4+
utils = require('../utils'),
5+
logger = require("../logger").syncCliLogger;
6+
7+
let printSpecsStatus = (bsConfig, buildId) => {
8+
new Promise((resolve, reject) => {
9+
let backOffFactor = 3; // 3 seconds
10+
let options = {
11+
url: `${config.buildUrl}${buildId}`,
12+
auth: {
13+
user: bsConfig.auth.username,
14+
password: bsConfig.auth.access_key
15+
},
16+
headers: {
17+
'Content-Type': 'application/json',
18+
"User-Agent": utils.getUserAgent(),
19+
}
20+
}
21+
});
22+
}
23+
24+
exports.printSpecsStatus = printSpecsStatus;

bin/helpers/syncRunner.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ const Config = require("./config"),
44
Constants = require("./constants"),
55
utils = require("./utils"),
66
request = require('request'),
7+
syncSpecsLogs = require('./sync/syncSpecsLogs'),
78
specDetails = require('./sync/failedSpecsDetails'),
89
{ table, getBorderCharacters } = require('table'),
910
chalk = require('chalk');
1011

1112
exports.pollBuildStatus = (bsConfig, buildId) => {
1213
logBuildDetails().then((data) => {
13-
printSpecsStatus();
14+
return syncSpecsLogs.printSpecsStatus(bsConfig, buildId);
1415
}).then((data) => {
1516
printSpecsRunSummary();
1617
}).then((data) => {

0 commit comments

Comments
 (0)