8000 BTS-1076: bulk test, don't use graph module by dothebart · Pull Request #17319 · arangodb/arangodb · GitHub
[go: up one dir, main page]

Skip to content

BTS-1076: bulk test, don't use graph module #17319

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 2 commits into from
Oct 12, 2022
Merged
Changes from all 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
18 changes: 12 additions & 6 deletions tests/js/common/shell/shell-pregel-components.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,25 +102,27 @@ function componentsTestSuite() {

let lcg = createRand();

let edges = [];
let vertices = [];
for (let c = 0; c < numComponents; c++) {
let edges = [];
for (let x = 0; x < m; x++) {
let fromID = String(c) + ":" + Math.floor(lcg() * n);
let toID = String(c) + ":" + Math.floor(lcg() * n);
let from = vColl + '/' + fromID;
let to = vColl + '/' + toID;
edges.push({_from: from, _to: to, vertex: String(fromID)});
}
db[eColl].insert(edges);

for (let x = 0; x < n; x++) {
let fromID = String(c) + ":" + x;
let toID = String(c) + ":" + (x + 1);
let from = vColl + '/' + fromID;
let to = vColl + '/' + toID;
db[eColl].insert({_from: from, _to: to, vertex: String(fromID)});
vertices.push({_from: from, _to: to, vertex: String(fromID)});
}
}
db[eColl].insert(edges);
db[eColl].insert(vertices);

console.log("Got %s edges", db[eColl].count());
assertEqual(db[eColl].count(), numComponents * m + numComponents * n);
Expand Down Expand Up @@ -175,15 +177,19 @@ function componentsTestSuite() {
} catch (err) {
}

const graph = graph_module._create(problematicGraphName, [graph_module._relation(e, v, v)]);
graph_module._create(problematicGraphName, [graph_module._relation(e, v, v)]);

let vertdocs = [];
vertices.forEach(vertex => {
graph[v].save({_key: vertex});
vertdocs.push({_key: vertex});
});
db[v].save(vertdocs);

let edgedocs = [];
edges.forEach(([from, to]) => {
graph[e].save({_from: `${v}/${from}`, _to: `${v}/${to}`});
edgedocs.push({_from: `${v}/${from}`, _to: `${v}/${to}`});
});
db[e].save(edgedocs);
}
},

Expand Down
0