8000 setUpAll/tearDownAll for performance reasons (#17322) (#17410) · arangodb/arangodb@8422b9d · GitHub
[go: up one dir, main page]

Skip to content

Commit 8422b9d

Browse files
authored
setUpAll/tearDownAll for performance reasons (#17322) (#17410)
1 parent 13e6d7c commit 8422b9d

5 files changed

+304
-52
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/* jshint globalstrict:false, strict:false, maxlen: 200 */
2+
/* global fail, assertTrue, assertFalse, assertEqual, assertNotUndefined, arango */
3+
4+
// //////////////////////////////////////////////////////////////////////////////
5+
// / @brief ArangoTransaction sTests
6+
// /
7+
// /
8+
// / DISCLAIMER
9+
// /
10+
// / Copyright 2018 ArangoDB GmbH, Cologne, Germany
11+
// /
12+
// / Licensed under the Apache License, Version 2.0 (the "License")
13+
// / you may not use this file except in compliance with the License.
14+
// / You may obtain a copy of the License at
15+
// /
16+
// / http://www.apache.org/licenses/LICENSE-2.0
17+
// /
18+
// / Unless required by applicable law or agreed to in writing, software
19+
// / distributed under the License is distributed on an "AS IS" BASIS,
20+
// / WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21+
// / See the License for the specific language governing permissions and
22+
// / limitations under the License.
23+
// /
24+
// / Copyright holder is triAGENS GmbH, Cologne, Germany
25+
// /
26+
// / @author Jan Steemann
27+
// //////////////////////////////////////////////////////////////////////////////
28+
29+
const internal = require('internal');
30+
const fs = require("fs");
31+
const jsunity = require("jsunity");
32+
const deriveTestSuite = require('@arangodb/test-helper').deriveTestSuite;
33+
const base = require(fs.join(internal.pathForTesting('client'),
34+
'shell', 'shell-iterators.inc'));
35+
36+
function StandaloneAqlIteratorReadSuite() {
37+
'use strict';
38+
39+
const ctx = {
40+
query: (...args) => internal.db._query(...args),
41+
collection: (name) => internal.db[name],
42+
abort: () => {},
43+
};
44+
const permute = function(run) {
45+
[ {}, {intermediateCommitCount: 111} ].forEach((opts) => {
46+
run(ctx, opts);
47+
});
48+
};
49+
50+
let suite = {};
51+
deriveTestSuite(base.IteratorReadSuite(permute, true), suite, '_StandaloneAqlRead');
52+
return suite;
53+
}
54+
55+
jsunity.run(StandaloneAqlIteratorReadSuite);
56+
57+
return jsunity.done();
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
/* jshint globalstrict:false, strict:false, maxlen: 200 */
2+
/* global fail, assertTrue, assertFalse, assertEqual, assertNotUndefined, arango */
3+
4+
// //////////////////////////////////////////////////////////////////////////////
5+
// / @brief ArangoTransaction sTests
6+
// /
7+
// /
8+
// / DISCLAIMER
9+
// /
10+
// / Copyright 2018 ArangoDB GmbH, Cologne, Germany
11+
// /
12+
// / Licensed under the Apache License, Version 2.0 (the "License")
13+
// / you may not use this file except in compliance with the License.
14+
// / You may obtain a copy of the License at
15+
// /
16+
// / http://www.apache.org/licenses/LICENSE-2.0
17+
// /
18+
// / Unless required by applicable law or agreed to in writing, software
19+
// / distributed under the License is distributed on an "AS IS" BASIS,
20+
// / WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21+
// / See the License for the specific language governing permissions and
22+
// / limitations under the License.
23+
// /
24+
// / Copyright holder is triAGENS GmbH, Cologne, Germany
25+
// /
26+
// / @author Jan Steemann
27+
// //////////////////////////////////////////////////////////////////////////////
28+
29+
const internal = require('internal');
30+
const fs = require("fs");
31+
const jsunity = require("jsunity");
32+
const deriveTestSuite = require('@arangodb/test-helper').deriveTestSuite;
33+
const base = require(fs.join(internal.pathForTesting('client'),
34+
'shell', 'shell-iterators.inc'));
35+
36+
function TransactionIteratorReadSuite() {
37+
'use strict';
38+
39+
let permute = function(run) {
40+
[ {}, /*{intermediateCommitCount: 111}*/ ].forEach((opts) => {
41+
const trxOpts = {
42+
collections: {
43+
write: [base.cn, base.ecn]
44+
},
45+
};
46+
const ctx = internal.db._createTransaction(Object.assign(trxOpts, opts));
47+
run(ctx, opts);
48+
});
49+
};
50+
51+
let suite = {};
52+
deriveTestSuite(base.IteratorReadSuite(permute), suite, '_StreamingTrx');
53+
return suite;
54+
}
55+
56+
jsunity.run(TransactionIteratorReadSuite);
57+
58+
return jsunity.done();
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/* jshint globalstrict:false, strict:false, maxlen: 200 */
2+
/* global fail, assertTrue, assertFalse, assertEqual, assertNotUndefined, arango */
3+
4+
// //////////////////////////////////////////////////////////////////////////////
5+
// / @brief ArangoTransaction sTests
6+
// /
7+
// /
8+
// / DISCLAIMER
9+
// /
10+
// / Copyright 2018 ArangoDB GmbH, Cologne, Germany
11+
// /
12+
// / Licensed under the Apache License, Version 2.0 (the "License")
13+
// / you may not use this file except in compliance with the License.
14+
// / You may obtain a copy of the License at
15+
// /
16+
// / http://www.apache.org/licenses/LICENSE-2.0
17+
// /
18+
// / Unless required by applicable law or agreed to in writing, software
19+
// / distributed under the License is distributed on an "AS IS" BASIS,
20+
// / WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21+
// / See the License for the specific language governing permissions and
22+
// / limitations under the License.
23+
// /
24+
// / Copyright holder is triAGENS GmbH, Cologne, Germany
25+
// /
26+
// / @author Jan Steemann
27+
// //////////////////////////////////////////////////////////////////////////////
28+
29+
const internal = require('internal');
30+
const fs = require("fs");
31+
const jsunity = require("jsunity");
32+
const deriveTestSuite = require('@arangodb/test-helper').deriveTestSuite;
33+
const base = require(fs.join(internal.pathForTesting('client'),
34+
'shell', 'shell-iterators.inc'));
35+
36+
function StandaloneAqlIteratorWriteSuite() {
37+
'use strict';
38+
39+
const ctx = {
40+
query: (...args) => internal.db._query(...args),
41+
collection: (name) => internal.db[name],
42+
abort: () => {},
43+
};
44+
const permute = function(run) {
45+
[ {}, {intermediateCommitCount: 111} ].forEach((opts) => {
46+
run(ctx, opts);
47+
});
48+
};
49+
50+
let suite = {};
51+
deriveTestSuite(base.IteratorWriteSuite(permute, true), suite, '_StandaloneAqlRead');
52+
return suite;
53+
}
54+
55+
jsunity.run(StandaloneAqlIteratorWriteSuite);
56+
57+
return jsunity.done();
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
/* jshint globalstrict:false, strict:false, maxlen: 200 */
2+
/* global fail, assertTrue, assertFalse, assertEqual, assertNotUndefined, arango */
3+
4+
// //////////////////////////////////////////////////////////////////////////////
5+
// / @brief ArangoTransaction sTests
6+
// /
7+
// /
8+
// / DISCLAIMER
9+
// /
10+
// / Copyright 2018 ArangoDB GmbH, Cologne, Germany
11+
// /
12+
// / Licensed under the Apache License, Version 2.0 (the "License")
13+
// / you may not use this file except in compliance with the License.
14+
// / You may obtain a copy of the License at
15+
// /
16+
// / http://www.apache.org/licenses/LICENSE-2.0
17+
// /
18+
// / Unless required by applicable law or agreed to in writing, software
19+
// / distributed under the License is distributed on an "AS IS" BASIS,
20+
// / WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21+
// / See the License for the specific language governing permissions and
22+
// / limitations under the License.
23+
// /
24+
// / Copyright holder is triAGENS GmbH, Cologne, Germany
25+
// /
26+
// / @author Jan Steemann
27+
// //////////////////////////////////////////////////////////////////////////////
28+
29+
const internal = require('internal');
30+
const fs = require("fs");
31+
const jsunity = require("jsunity");
32+
const deriveTestSuite = require('@arangodb/test-helper').deriveTestSuite;
33+
const base = require(fs.join(internal.pathForTesting('client'),
34+
'shell', 'shell-iterators.inc'));
35+
36+
function TransactionIteratorWriteSuite() {
37+
'use strict';
38+
39+
let permute = function(run) {
40+
[ {}, /*{intermediateCommitCount: 111}*/ ].forEach((opts) => {
41+
const trxOpts = {
42+
collections: {
43+
write: [base.cn, base.ecn]
44+
},
45+
};
46+
const ctx = internal.db._createTransaction(Object.assign(trxOpts, opts));
47+
run(ctx, opts);
48+
});
49+
};
50+
51+
let suite = {};
52+
deriveTestSuite(base.IteratorWriteSuite(permute), suite, '_StreamingTrx');
53+
return suite;
54+
}
55+
56+
jsunity.run(TransactionIteratorWriteSuite);
57+
58+
return jsunity.done();

0 commit comments

Comments
 (0)
0