Skip to content

Commit 0ef7dc5

Browse files
Karan NagpalKaran Nagpal
authored andcommitted
Fix: Handle dynamic width calculation for CI/CD tests running with --sync
1 parent f1239f1 commit 0ef7dc5

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

bin/helpers/constants.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ const syncCLI = {
55
LOGS: {
66
INIT_LOG: "All tests:"
77
},
8-
INITIAL_DELAY_MULTIPLIER: 10
8+
INITIAL_DELAY_MULTIPLIER: 10,
9+
DEFAULT_LINE_SEP: "\n--------------------------------------------------------------------------------",
910
};
1011

1112
const userMessages = {

bin/helpers/sync/syncSpecsLogs.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ let specSummary = {
1515
}
1616
let noWrap = false;
1717
let terminalWidth = (process.stdout.columns) * 0.9;
18-
let lineSeparator = "\n" + "-".repeat(terminalWidth);
18+
let lineSeparator = Constants.syncCLI.DEFAULT_LINE_SEP;
19+
if (!utils.isUndefined(terminalWidth)) lineSeparator = "\n" + "-".repeat(terminalWidth);
1920

2021
let getOptions = (auth, build_id) => {
2122
return {
@@ -38,7 +39,7 @@ let getTableConfig = () => {
3839
colWidth = Math.floor(terminalWidth * 0.2);
3940

4041
// Do not autosize on terminal's width if no-wrap provided
41-
if (noWrap) {
42+
if (noWrap || utils.isUndefined(terminalWidth)) {
4243
centerWidth = 1;
4344
leftWidth = 100;
4445
colWidth = 30;
@@ -84,7 +85,7 @@ let setNoWrapParams = () => {
8485
noWrap = (process.env.SYNC_NO_WRAP && (process.env.SYNC_NO_WRAP === 'true'));
8586
// Do not show the separator based on terminal width if no-wrap provided.
8687
if (noWrap) {
87-
lineSeparator = "\n--------------------------------------------------------------------------------";
88+
lineSeparator = Constants.syncCLI.DEFAULT_LINE_SEP;
8889
}
8990
};
9091

0 commit comments

Comments
 (0)