Skip to content

Biojava genome migration to junit5 - #1126

Merged
josemduarte merged 5 commits into
biojava:masterfrom
arkanar611:biojava-genome-migration-to-junit5
Aug 28, 2026
Merged

Biojava genome migration to junit5#1126
josemduarte merged 5 commits into
biojava:masterfrom
arkanar611:biojava-genome-migration-to-junit5

Conversation

@arkanar611

Copy link
Copy Markdown

All tests in the biojava-genome module were migrated to junit5

@josemduarte

Copy link
Copy Markdown
Contributor

In principle this looks good, thank you. However we currently have an issue with tests (due to a failing external resource used during testing) that we'd like to fix before going with this junit5 refactoring.

@josemduarte josemduarte left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you, see some comments below.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Unused now, should be removed

@@ -21,25 +21,26 @@
package org.biojava.nbio.genome.io.fastq;

import org.junit.Assert;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Import from junit4. Could you move the import and corresponding usages below. AI tells me to use Assertions.assertThrows(X.class, () -> ...)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you remove this import and then replace the usages below. AI recommends:
FileAssert.assertEquals() -> assertIterableEquals(Files.readAllLines(), Files.readAllLines(), "the text")

After that you can get rid of the old dependency in pom.xml

Comment thread biojava-genome/pom.xml Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You can remove this dependency once the comment above is solved (see my other comment). For instance, this is important because this dep brings in the old junit4 transitively

@josemduarte

Copy link
Copy Markdown
Contributor

Also, please could you merge master into your branch. Then tests should be able to run cleanly.

Sergey Pyatykh added 3 commits August 28, 2026 13:01
Replace FileAssert and leftover JUnit 4 APIs so genome tests compile without junit-addons.
Replace leftover JUnit 4 APIs so genome tests compile without junit-addons.
@arkanar611

Copy link
Copy Markdown
Author

@josemduarte Thank you for reviewing my MR. I've removed junit-addons from dependencies and merged master branch changes but there are still some issues with biojava-protein-disorder tests https://github.com/biojava/biojava/actions/runs/33166795706/job/98834028902?pr=1126

@josemduarte josemduarte left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you for the changes, one more comment below.

Note that the failures were due to a UniProt server being down.

new File("src/test/resources/volvox_length_reference.gff3"));
Assertions.assertEquals(
Files.readString(new File("src/test/resources/volvox_length_reference.gff3").toPath()),
Files.readString(gffFile.toPath()),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

AI tells me that these 2 should be Files.readAllLines instead. Or otherwise tests will fail in windows (due to the hard-coded \n in

outputStream.write("##gff-version 3\n".getBytes());
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ok never mind: AI was wrong. It worked in CI. Though we are still seeing flakiness in UniProt servers

@josemduarte josemduarte left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM thanks

@josemduarte
josemduarte merged commit 2a57e19 into biojava:master Aug 28, 2026
2 of 10 checks 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.

2 participants