-
Notifications
You must be signed in to change notification settings - Fork 28
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
[FEAT] Add support for pushing the amplification results in a MongoDB database #850
Conversation
Pull Request Test Coverage Report for Build 2139
💛 - Coveralls |
The changes look good. Could you create a dedicated method for updating the database? i.e. not doing all the database stuff in |
Hi @danglotb :), you mean an update method which only update an already existed document document ? . If that's the case then they already have this updateOne or updateMany method which take in a filter query and a new document . More details here. Basicly it would look like this, if you was to update one document matching with the provided query.
Sorry if I missunderstood something , please point out if that's the case :) . |
@@ -235,6 +239,14 @@ public TestSelectorElementReport report() { | |||
} | |||
|
|||
private String reportStdout() { | |||
if (MongodbManager.getInstance().getDbConnectable()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @tailp,
I would like the following if block in a dedicated method, like reportMongoDB()
.
Basically, create dedicated methods for all actions that are done on the mongoDB, in order to separate the mongoDB management from the rest of the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah I think I understand your point :). I made some changes just now. Hopefully this passes the tests on the CI and is what you wanted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi @danglotb, I put all codeblocks into reportMongoDB() functions :) in the latest commit. I would be nice if you have some spare time to check if it's ok to go or if some more fixes I need to do. Thank you for your patience.
Per our discussion today, we will split this PR in two
|
@@ -222,6 +223,10 @@ public TestSelectorElementReport report() { | |||
.append("%") | |||
.append(AmplificationHelper.LINE_SEPARATOR); | |||
lastReport = new TestSelectorElementReportImpl(report.toString(), jsonReport(coverageResults)); | |||
|
|||
// Sending data to Mongodb | |||
MongodbManager.getInstance().reportJacocoMongoDb(this.currentClassTestToBeAmplified.getQualifiedName(),"" + this.initialCoverage.getInstructionsCovered(),"" + coverageResults.getInstructionsCovered(),"" + coverageResults.getInstructionsTotal()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
collector.reportJacocotInformation()
@@ -235,6 +236,8 @@ public TestSelectorElementReport report() { | |||
} | |||
|
|||
private String reportStdout() { | |||
MongodbManager.getInstance().reportPitMutantMongoDB(this.currentClassTestToBeAmplified.getQualifiedName(),"" + this.originalKilledMutants.size(),"" + this.getNbTotalNewMutantKilled()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
collector.reportMutantInformation()
@@ -59,6 +60,10 @@ public static void run() { | |||
// global report handling | |||
Main.GLOBAL_REPORT.output(); | |||
Main.GLOBAL_REPORT.reset(); | |||
// Send info to Mongodb | |||
if (MongodbManager.getInstance().getDbConnectable()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
collector.reportInitInformation()
Will open a new PR for this :) . |
Hi , related issue (#843) . Ready for merging after done reviewing and change requests :).