-
Notifications
You must be signed in to change notification settings - Fork 12
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
EVA-3445 Added test for accession-commons recover method #425
Conversation
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.
Mostly comments to help my own understanding.
private static final String TEST_DB = "test-db"; | ||
|
||
@Autowired | ||
private SubmittedVariantAccessioningRepository repository; |
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.
private SubmittedVariantAccessioningRepository repository; | |
private SubmittedVariantAccessioningRepository mongoRepository; |
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.
done
} | ||
|
||
private void verifyInitialDBState() { | ||
assertEquals(30, repository.count()); |
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.
assertEquals(30, repository.count()); | |
// Initial state is 2 blocks are "reserved" but not "committed" in postgresql | |
// 30 accessions have been used in mongoDB but are not reflected in the block allocation table | |
assertEquals(30, repository.count()); |
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.
done
assertEquals(5000000059l, block2.getLastValue()); | ||
} | ||
|
||
private void runJob() throws Exception { |
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.
private void runJob() throws Exception { | |
private void runAccessioningJob() throws Exception { |
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.
done
repository.deleteAll(); | ||
|
||
List<SubmittedVariantEntity> submittedVariantEntityList = new ArrayList<>(); | ||
for(long i=5000000000l;i<5000000030l;i++){ |
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.
Can you change the range slightly so that one block get committed partially ?
I would suggest adding a 3rd block 60->90 in the block allocation table and 1 or 2 submitted variant accession in this range.
I'd be curious to see how the recover state deal with this situation.
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.
done
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.
These tests are super clearly written, even without the additional document which is also very helpful - great job!
No description provided.