Skip to content

Commit

Permalink
add index for tests.id
Browse files Browse the repository at this point in the history
resolves: adoptium#915

Signed-off-by: Lan Xia <Lan_Xia@ca.ibm.com>
  • Loading branch information
llxia committed Oct 2, 2024
1 parent 57efcd1 commit 841a046
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion TestResultSummaryService/Database.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ let db;
});
logger.info('Index created: ', urlBuildNameBuildNumIndex);

const testIdIndex = await testResultsDB.createIndex({ 'tests._id': 1 });
logger.info('Index created: ', testIdIndex);

const result = await testResultsDB.listIndexes().toArray();
logger.info('Existing testResults indexes:');
for (const doc of result) {
Expand Down Expand Up @@ -176,7 +179,7 @@ class Database {
{ $match: { 'childBuilds.buildName': { $regex: buildNameRegex } } },
{
$group: {
_id: id ,
_id: id,
total: { $sum: '$childBuilds.testSummary.total' },
executed: { $sum: '$childBuilds.testSummary.executed' },
passed: { $sum: '$childBuilds.testSummary.passed' },
Expand Down

0 comments on commit 841a046

Please sign in to comment.