Github user karuturi commented on the pull request:

    https://github.com/apache/cloudstack/pull/793#issuecomment-139980724
  
    you are decreasing the code coverage with these changes. especially with 
interface changes and new methods, I think unittests should be there.
    
    This is not the final state of this code. It will go through multiple 
iterations with different developers touching it and there should be a check 
that the code you have written behaves in the expected way even after those 
changes.
    
    for unittests, you could mock jobMgr to return failed jobs with 
snapshots(and some other jobs as well) in different states and then assert what 
you are expecting the code to do actually happens. There can be some cases 
where the deserialization might fail etc. you could test those cases as well. 
    
    For example, the current code will fail with NPE if 
jobMgr.findFailureAsyncJobs returns null. I dont know if it can, there is not 
javadoc describing its return value. It will be good to write a unit test for 
this case and assert that you code doesnt cause system error if that happens.
    
    You could also add marvin test case to cover this scenario. Basically, 
there should be an automated way to test the code you have written.
    
    Also, please post the test results(manual or automatic) you already 
executed.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to