Skip to content
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

Merged
merged 7 commits into from
Nov 21, 2023

Conversation

nitin-ebi
Copy link
Contributor

No description provided.

@nitin-ebi nitin-ebi self-assigned this Nov 16, 2023
Copy link
Member

@tcezard tcezard left a 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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
private SubmittedVariantAccessioningRepository repository;
private SubmittedVariantAccessioningRepository mongoRepository;

Copy link
Contributor Author

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());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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());

Copy link
Contributor Author

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 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
private void runJob() throws Exception {
private void runAccessioningJob() throws Exception {

Copy link
Contributor Author

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++){
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Contributor

@apriltuesday apriltuesday left a 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!

@nitin-ebi nitin-ebi merged commit 2e7fe10 into EBIvariation:master Nov 21, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants