Skip to content

Commit 81cb55b

Browse files
committed
test(*): move and enable shard logging reporter
1 parent 2ab95d9 commit 81cb55b

File tree

2 files changed

+25
-25
lines changed

2 files changed

+25
-25
lines changed

projects/igniteui-angular/src/lib/test-utils/configure-suite.ts

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -169,28 +169,3 @@ function setupJasmineCurrentTest() {
169169
setupJasmineCurrentTestDone = true;
170170
}
171171
}
172-
173-
// TODO: enable on re-run by selecting enable debug logging
174-
// https://docs.github.com/en/actions/monitoring-and-troubleshooting-workflows/troubleshooting-workflows/enabling-debug-logging
175-
const shardLogging = false;
176-
if (shardLogging) {
177-
const myReporter = {
178-
suiteStarted: function(result) {
179-
const id = new URLSearchParams(window.parent.location.search).get('id');
180-
console.log(`[${id}] Suite started: ${result.fullName}`);
181-
},
182-
suiteDone: function(result) {
183-
const id = new URLSearchParams(window.parent.location.search).get('id');
184-
console.log(`[${id}] Suite: ${result.fullName} has ${result.status}`);
185-
for (const expectation of result.failedExpectations) {
186-
console.log('Suite ' + expectation.message);
187-
console.log(expectation.stack);
188-
}
189-
var memory = (performance as any).memory;
190-
console.log(`[${id}] totalJSHeapSize: ${memory['totalJSHeapSize']} usedJSHeapSize: ${memory['usedJSHeapSize']} jsHeapSizeLimit: ${memory['jsHeapSizeLimit']}`);
191-
if (memory['totalJSHeapSize'] >= memory['jsHeapSizeLimit'] )
192-
console.log( '--------------------Heap Size limit reached!!!-------------------');
193-
},
194-
};
195-
jasmine.getEnv().addReporter(myReporter);
196-
}

projects/igniteui-angular/src/lib/test-utils/helper-utils.spec.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,28 @@ export class TestNgZone extends NgZone {
9191
this.onStable.emit(null);
9292
}
9393
}
94+
95+
// TODO: enable on re-run by selecting enable debug logging
96+
// https://docs.github.com/en/actions/monitoring-and-troubleshooting-workflows/troubleshooting-workflows/enabling-debug-logging
97+
const shardLogging = true;
98+
if (shardLogging) {
99+
const myReporter = {
100+
suiteStarted: function(result) {
101+
const id = new URLSearchParams(window.parent.location.search).get('id');
102+
console.log(`[${id}] Suite started: ${result.fullName}`);
103+
},
104+
suiteDone: function(result) {
105+
const id = new URLSearchParams(window.parent.location.search).get('id');
106+
console.log(`[${id}] Suite: ${result.fullName} has ${result.status}`);
107+
for (const expectation of result.failedExpectations) {
108+
console.log('Suite ' + expectation.message);
109+
console.log(expectation.stack);
110+
}
111+
var memory = (performance as any).memory;
112+
console.log(`[${id}] totalJSHeapSize: ${memory['totalJSHeapSize']} usedJSHeapSize: ${memory['usedJSHeapSize']} jsHeapSizeLimit: ${memory['jsHeapSizeLimit']}`);
113+
if (memory['totalJSHeapSize'] >= memory['jsHeapSizeLimit'] )
114+
console.log( '--------------------Heap Size limit reached!!!-------------------');
115+
},
116+
};
117+
jasmine.getEnv().addReporter(myReporter);
118+
}

0 commit comments

Comments
 (0)