Skip to content

Commit fad4b36

Browse files
committed
improve collecting csv if the last one fails
1 parent 80ac7ae commit fad4b36

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

test/jasmine/performance_tests/all_test.js

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ var nSamples = require('./assets/constants').nSamples;
88
var gd = createGraphDiv();
99

1010
const samples = Array.from({ length: nSamples }, (_, i) => i);
11-
const nTimes = samples.length - 1;
1211

1312
var tests = [];
1413

@@ -51,7 +50,7 @@ for(let traceType of ['box', 'violin']) {
5150
for(let traceType of ['scatter', 'scattergl', 'scattergeo']) {
5251
for(let mode of ['markers', 'lines', 'markers+lines']) {
5352
for(let nTraces of [1, 10, 100]) {
54-
for(let n of [1000, 2000, 4000, 8000, 16000, 32000, 64000]) {
53+
for(let n of [1000, 2000, 4000, 8000, 16000, 32000]) {
5554
tests.push({
5655
n:n,
5756
nTraces: nTraces,
@@ -266,14 +265,16 @@ function makeScatterGeo(spec) {
266265
}
267266

268267

269-
tests.forEach(function(spec, index) {
270-
describe('Performance test ' + spec.nTraces + ' ' + spec.traceType + (spec.mode ? ' | mode: ' + spec.mode : '') + ' | size:' + spec.n, function() {
271-
'use strict';
268+
describe('Performance test various traces', function() {
269+
'use strict';
272270

273-
afterEach(function(done) {
274-
delay(100)().then(done);
275-
});
271+
afterAll(function(done) {
272+
downloadCSV(tests);
273+
// delay for the download to be completed
274+
delay(1000)().then(done)
275+
});
276276

277+
tests.forEach(function(spec, index) {
277278
samples.forEach(function(t) {
278279
it('turn: ' + t, function(done) {
279280
var startTime, endTime;
@@ -295,10 +296,6 @@ tests.forEach(function(spec, index) {
295296
expect(nodes.size()).toEqual(spec.nTraces);
296297
}
297298

298-
if(t === nTimes && index === tests.length - 1) {
299-
downloadCSV(tests);
300-
}
301-
302299
done();
303300
});
304301
});

test/jasmine/performance_tests/assets/post_process.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,19 @@ exports.downloadCSV = function(allTests) {
66
'run id',
77
'rendering time(ms)'
88
].join(',') + '\n';
9+
910
for(var k = 0; k < allTests.length; k++) {
1011
var test = allTests[k];
1112

12-
for(var i = 0; i < test.raw.length; i++) {
13+
var raw = test.raw || [];
14+
15+
for(var i = 0; i < raw.length; i++) {
1316
str += [
1417
(test.nTraces || 1),
1518
(test.traceType + (test.mode ? ' ' + test.mode : '')),
1619
test.n,
1720
i,
18-
test.raw[i]
21+
raw[i]
1922
].join(',') + '\n';
2023
}
2124
}

0 commit comments

Comments
 (0)