8000 setUpAll/tearDownAll for performance reasons by dothebart · Pull Request #17322 · arangodb/arangodb · GitHub
[go: up one dir, main page]

Skip to content

setUpAll/tearDownAll for performance reasons #17322

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Oct 12, 2022
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions tests/js/client/shell/shell-iterators-read-standalone.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/* jshint globalstrict:false, strict:false, maxlen: 200 */
/* global fail, assertTrue, assertFalse, assertEqual, assertNotUndefined, arango */

// //////////////////////////////////////////////////////////////////////////////
// / @brief ArangoTransaction sTests
// /
// /
// / DISCLAIMER
// /
// / Copyright 2018 ArangoDB GmbH, Cologne, Germany
// /
// / Licensed under the Apache License, Version 2.0 (the "License")
// / you may not use this file except in compliance with the License.
// / You may obtain a copy of the License at
// /
// / http://www.apache.org/licenses/LICENSE-2.0
// /
// / Unless required by applicable law or agreed to in writing, software
// / distributed under the License is distributed on an "AS IS" BASIS,
// / WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// / See the License for the specific language governing permissions and
// / limitations under the License.
// /
// / Copyright holder is triAGENS GmbH, Cologne, Germany
// /
// / @author Jan Steemann
// //////////////////////////////////////////////////////////////////////////////

const internal = require('internal');
const fs = require("fs");
const jsunity = require("jsunity");
const deriveTestSuite = require('@arangodb/test-helper').deriveTestSuite;
const base = require(fs.join(internal.pathForTesting('client'),
'shell', 'shell-iterators.inc'));

function StandaloneAqlIteratorReadSuite() {
'use strict';

const ctx = {
query: (...args) => internal.db._query(...args),
collection: (name) => internal.db[name],
abort: () => {},
};
const permute = function(run) {
[ {}, {intermediateCommitCount: 111} ].forEach((opts) => {
run(ctx, opts);
});
};
global.read = true;

let suite = {};
deriveTestSuite(base.IteratorReadSuite(permute, true), suite, '_StandaloneAqlRead');
return suite;
}

jsunity.run(StandaloneAqlIteratorReadSuite);

return jsunity.done();
58 changes: 58 additions & 0 deletions tests/js/client/shell/shell-iterators-read-transaction.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/* jshint globalstrict:false, strict:false, maxlen: 200 */
/* global fail, assertTrue, assertFalse, assertEqual, assertNotUndefined, arango */

// //////////////////////////////////////////////////////////////////////////////
// / @brief ArangoTransaction sTests
// /
// /
// / DISCLAIMER
// /
// / Copyright 2018 ArangoDB GmbH, Cologne, Germany
// /
// / Licensed under the Apache License, Version 2.0 (the "License")
// / you may not use this file except in compliance with the License.
// / You may obtain a copy of the License at
// /
// / http://www.apache.org/licenses/LICENSE-2.0
// /
// / Unless required by applicable law or agreed to in writing, software
// / distributed under the License is distributed on an "AS IS" BASIS,
// / WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// / See the License for the specific language governing permissions and
// / limitations under the License.
// /
// / Copyright holder is triAGENS GmbH, Cologne, Germany
// /
// / @author Jan Steemann
// //////////////////////////////////////////////////////////////////////////////

const internal = require('internal');
const fs = require("fs");
const jsunity = require("jsunity");
const deriveTestSuite = require('@arangodb/test-helper').deriveTestSuite;
const base = require(fs.join(internal.pathForTesting('client'),
'shell', 'shell-iterators.inc'));

function TransactionIteratorReadSuite() {
'use strict';

let permute = function(run) {
[ {}, /*{intermediateCommitCount: 111}*/ ].forEach((opts) => {
const trxOpts = {
collections: {
write: [base.cn, base.ecn]
},
};
const ctx = internal.db._createTransaction(Object.assign(trxOpts, opts));
run(ctx, opts);
});
};

let suite = {};
deriveTestSuite(base.IteratorReadSuite(permute), suite, '_StreamingTrx');
return suite;
}

jsunity.run(TransactionIteratorReadSuite);

return jsunity.done();
58 changes: 58 additions & 0 deletions tests/js/client/shell/shell-iterators-write-standalane.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/* jshint globalstrict:false, strict:false, maxlen: 200 */
/* global fail, assertTrue, assertFalse, assertEqual, assertNotUndefined, arango */

// //////////////////////////////////////////////////////////////////////////////
// / @brief ArangoTransaction sTests
// /
// /
// / DISCLAIMER
// /
// / Copyright 2018 ArangoDB GmbH, Cologne, Germany
// /
// / Licensed under the Apache License, Version 2.0 (the "License")
// / you may not use this file except in compliance with the License.
// / You may obtain a copy of the License at
// /
// / http://www.apache.org/licenses/LICENSE-2.0
// /
// / Unless required by applicable law or agreed to in writing, software
// / distributed under the License is distributed on an "AS IS" BASIS,
// / WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// / See the License for the specific language governing permissions and
// / limitations under the License.
// /
// / Copyright holder is triAGENS GmbH, Cologne, Germany
// /
// / @author Jan Steemann
// //////////////////////////////////////////////////////////////////////////////

const internal = require('internal');
const fs = require("fs");
const jsunity = require("jsunity");
const deriveTestSuite = require('@arangodb/test-helper').deriveTestSuite;
const base = require(fs.join(internal.pathForTesting('client'),
'shell', 'shell-iterators.inc'));

function StandaloneAqlIteratorWriteSuite() {
'use strict';

const ctx = {
query: (...args) => internal.db._query(...args),
collection: (name) => internal.db[name],
abort: () => {},
};
const permute = function(run) {
[ {}, {intermediateCommitCount: 111} ].forEach((opts) => {
run(ctx, opts);
});
};
global.read = true;

let suite = {};
deriveTestSuite(base.IteratorWriteSuite(permute, true), suite, '_StandaloneAqlRead');
return suite;
}

jsunity.run(StandaloneAqlIteratorWriteSuite);

return jsunity.done();
58 changes: 58 additions & 0 deletions tests/js/client/shell/shell-iterators-write-transaction.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/* jshint globalstrict:false, strict:false, maxlen: 200 */
/* global fail, assertTrue, assertFalse, assertEqual, assertNotUndefined, arango */

// //////////////////////////////////////////////////////////////////////////////
// / @brief ArangoTransaction sTests
// /
// /
// / DISCLAIMER
// /
// / Copyright 2018 ArangoDB GmbH, Cologne, Germany
// /
// / Licensed under the Apache License, Version 2.0 (the "License")
// / you may not use this file except in compliance with the License.
// / You may obtain a copy of the License at
// /
// / http://www.apache.org/licenses/LICENSE-2.0
// /
// / Unless required by applicable law or agreed to in writing, software
// / distributed under the License is distributed on an "AS IS" BASIS,
// / WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// / See the License for the specific language governing permissions and
// / limitations under the License.
// /
// / Copyright holder is triAGENS GmbH, Cologne, Germany
// /
// / @author Jan Steemann
// //////////////////////////////////////////////////////////////////////////////

const internal = require('internal');
const fs = require("fs");
const jsunity = require("jsunity");
const deriveTestSuite = require('@arangodb/test-helper').deriveTestSuite;
const base = require(fs.join(internal.pathForTesting('client'),
'shell', 'shell-iterators.inc'));

function TransactionIteratorWriteSuite() {
'use strict';

let permute = function(run) {
[ {}, /*{intermediateCommitCount: 111}*/ ].forEach((opts) => {
const trxOpts = {
collections: {
write: [base.cn, base.ecn]
},
};
const ctx = internal.db._createTransaction(Object.assign(trxOpts, opts));
run(ctx, opts);
});
};

let suite = {};
deriveTestSuite(base.IteratorWriteSuite(permute), suite, '_StreamingTrx');
return suite;
}

jsunity.run(TransactionIteratorWriteSuite);

return jsunity.done();
Loading
0