[Libreoffice-commits] online.git: 2 commits - loleaflet/Makefile loleaflet/spec
Mihai Varga
mihai.varga at collabora.com
Fri Sep 11 00:43:02 PDT 2015
dev/null |binary
loleaflet/Makefile | 20 ++++++++++++++++
loleaflet/spec/data/eval.odg |binary
loleaflet/spec/data/eval.odp |binary
loleaflet/spec/data/eval.ods |binary
loleaflet/spec/data/eval.odt |binary
loleaflet/spec/headlessLoadTest.js | 36 ++++++++++++++++++------------
loleaflet/spec/loadtest/LoadTestSpec.js | 2 -
loleaflet/spec/loleaflet/loleafletSpec.js | 2 -
loleaflet/spec/tilebench/TileBenchSpec.js | 2 -
10 files changed, 45 insertions(+), 17 deletions(-)
New commits:
commit 612400dcf2c1542a99802bc6192cda5146541ba2
Author: Mihai Varga <mihai.varga at collabora.com>
Date: Fri Sep 11 10:41:23 2015 +0300
loleaflet: automated loading test
run: make load-test
It generates the necessary 500 documents under spec/data/load-test and
spawns 20 nodejs clients
diff --git a/loleaflet/Makefile b/loleaflet/Makefile
index 841d69b..6599877 100644
--- a/loleaflet/Makefile
+++ b/loleaflet/Makefile
@@ -23,3 +23,23 @@ dist: all
loleaflet.spec: loleaflet.spec.in Makefile
sed -e 's/@PACKAGE_VERSION@/$(VERSION)/g' <loleaflet.spec.in >loleaflet.spec
+
+spec/data/load-test:
+ if [ ! -d spec/data/load_test ]; then \
+ mkdir -p spec/data/load_test; \
+ for i in $$(seq 1 125); \
+ do \
+ cp spec/data/eval.odt spec/data/load_test/eval$$i.odt; \
+ cp spec/data/eval.odp spec/data/load_test/eval$$i.odp; \
+ cp spec/data/eval.ods spec/data/load_test/eval$$i.ods; \
+ cp spec/data/eval.odg spec/data/load_test/eval$$i.odg; \
+ done; \
+ fi
+
+load-test: spec/data/load-test
+ rm -rf load_test_out; \
+ mkdir load_test_out; \
+ for i in $$(seq 1 20); \
+ do \
+ mocha spec/headlessLoadTest.js > load_test_out/$$i.out 2>&1 & \
+ done;
diff --git a/loleaflet/spec/headlessLoadTest.js b/loleaflet/spec/headlessLoadTest.js
index cb7d5dd..bb32aba 100644
--- a/loleaflet/spec/headlessLoadTest.js
+++ b/loleaflet/spec/headlessLoadTest.js
@@ -8,19 +8,17 @@ if (typeof String.prototype.startsWith != 'function') {
}
describe('LoadTest', function () {
- // 10s timeout
- this.timeout(20000);
+ // 30s timeout
+ this.timeout(30000);
// set the slow time to 5ms knowing each test takes more than that,
// so the run time is always printed
this.slow(5);
var testsRan = 0,
+ testsToRun = 500;
tileSize = 256,
tileSizeTwips = 3000,
host = 'ws://localhost:9980';
- var docPath = 'file:///PATH';
- var docs = ['eval.odt', 'eval.odp'];
-
var _parseServerCmd = function (msg) {
var tokens = msg.split(/[ \n]+/);
var command = {};
@@ -56,16 +54,25 @@ describe('LoadTest', function () {
return command;
};
- before(function () {
- if (docPath === 'file:///PATH') {
- throw new Error('Document file path not set');
- }
- else if (docPath[docPath.length - 1] !== '/') {
- docPath += '/';
- }
- });
+ function shuffle(o){
+ for(var j, x, i = o.length; i; j = Math.floor(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x);
+ return o;
+ }
+
+ docPath = 'file://' + __dirname + '/data/load_test/';
+ var docs = [];
+ for (var i = 1; i <= 125; i++) {
+ docs.push('eval' + i + '.odt');
+ docs.push('eval' + i + '.odp');
+ docs.push('eval' + i + '.ods');
+ docs.push('eval' + i + '.odg');
+ }
+ docs = shuffle(docs);
docs.forEach(function (testDoc) {
+ if (testsRan >= testsToRun) {
+ return;
+ }
testsRan += 1;
describe('Document #' + testsRan + ' (' + testDoc + ')', function () {
var ws;
@@ -125,9 +132,10 @@ describe('LoadTest', function () {
return x >= 0 && y >= 0 && (x * tileSizeTwips < docWidthTwips) && (y * tileSizeTwips < docHeightTwips);
};
- after(function () {
+ after(function (done) {
ws.onmessage = function () {};
ws.close();
+ setTimeout(done, 20);
});
it('Connect to the server', function (done) {
commit 85127f19c24d411cf86f990d9d385027251aba20
Author: Mihai Varga <mihai.varga at collabora.com>
Date: Thu Sep 10 15:29:05 2015 +0300
loleaflet: removed lorem.odt and added other documents
diff --git a/loleaflet/spec/data/eval.odg b/loleaflet/spec/data/eval.odg
new file mode 100644
index 0000000..457722a
Binary files /dev/null and b/loleaflet/spec/data/eval.odg differ
diff --git a/loleaflet/spec/data/eval.odp b/loleaflet/spec/data/eval.odp
new file mode 100644
index 0000000..aac1f74
Binary files /dev/null and b/loleaflet/spec/data/eval.odp differ
diff --git a/loleaflet/spec/data/eval.ods b/loleaflet/spec/data/eval.ods
new file mode 100644
index 0000000..324eb7f
Binary files /dev/null and b/loleaflet/spec/data/eval.ods differ
diff --git a/loleaflet/spec/data/eval.odt b/loleaflet/spec/data/eval.odt
new file mode 100644
index 0000000..31d3377
Binary files /dev/null and b/loleaflet/spec/data/eval.odt differ
diff --git a/loleaflet/spec/data/lorem.odt b/loleaflet/spec/data/lorem.odt
deleted file mode 100644
index 1b26ee1..0000000
Binary files a/loleaflet/spec/data/lorem.odt and /dev/null differ
diff --git a/loleaflet/spec/headlessLoadTest.js b/loleaflet/spec/headlessLoadTest.js
index f9d5340..cb7d5dd 100644
--- a/loleaflet/spec/headlessLoadTest.js
+++ b/loleaflet/spec/headlessLoadTest.js
@@ -19,7 +19,7 @@ describe('LoadTest', function () {
host = 'ws://localhost:9980';
var docPath = 'file:///PATH';
- var docs = ['eval.odt', 'lorem.odt'];
+ var docs = ['eval.odt', 'eval.odp'];
var _parseServerCmd = function (msg) {
var tokens = msg.split(/[ \n]+/);
diff --git a/loleaflet/spec/loadtest/LoadTestSpec.js b/loleaflet/spec/loadtest/LoadTestSpec.js
index 7be5091..7d8c811 100644
--- a/loleaflet/spec/loadtest/LoadTestSpec.js
+++ b/loleaflet/spec/loadtest/LoadTestSpec.js
@@ -21,7 +21,7 @@ describe('LoadTest', function () {
});
var docPath = 'file:///PATH';
- var docs = ['eval.odt', 'lorem.odt'];
+ var docs = ['eval.odt'];
docs.forEach(function (testDoc) {
testsRan += 1;
diff --git a/loleaflet/spec/loleaflet/loleafletSpec.js b/loleaflet/spec/loleaflet/loleafletSpec.js
index dd8fe14..692d656 100644
--- a/loleaflet/spec/loleaflet/loleafletSpec.js
+++ b/loleaflet/spec/loleaflet/loleafletSpec.js
@@ -15,7 +15,7 @@ describe('TileBench', function () {
before(function () {
var htmlPath = window.location.pathname;
var dir = htmlPath.substring(0, htmlPath.lastIndexOf('/'));
- var fileURL = 'file://' + dir + '/data/lorem.odt';
+ var fileURL = 'file://' + dir + '/data/eval.odt';
// initialize the map and load the document
map = L.map('map', {
server: 'ws://localhost:9980',
diff --git a/loleaflet/spec/tilebench/TileBenchSpec.js b/loleaflet/spec/tilebench/TileBenchSpec.js
index b266848..6abd54e 100644
--- a/loleaflet/spec/tilebench/TileBenchSpec.js
+++ b/loleaflet/spec/tilebench/TileBenchSpec.js
@@ -16,7 +16,7 @@ describe('TileBench', function () {
before(function () {
var htmlPath = window.location.pathname;
var dir = htmlPath.substring(0, htmlPath.lastIndexOf('/'));
- var fileURL = 'file://' + dir + '/data/lorem.odt';
+ var fileURL = 'file://' + dir + '/data/eval.odt';
// initialize the map and load the document
map = L.map('map', {
server: 'ws://localhost:9980',
More information about the Libreoffice-commits
mailing list