refactor(libanki): migrate TestClass and rename TestClass to AnkiTest#18813
Merged
mikehardy merged 2 commits intoankidroid:mainfrom Jul 20, 2025
Merged
refactor(libanki): migrate TestClass and rename TestClass to AnkiTest#18813mikehardy merged 2 commits intoankidroid:mainfrom
TestClass and rename TestClass to AnkiTest#18813mikehardy merged 2 commits intoankidroid:mainfrom
Conversation
libanki:testutils, migrate TestClass and rename to AnkiTestlibanki:testutils, migrate TestClass and rename TestClass to AnkiTest
da82017 to
1da9512
Compare
1da9512 to
54a24ab
Compare
5 tasks
Member
Author
|
I'll split this out into smaller PRs, probably don't have maintainer effort for something this size |
5 tasks
54a24ab to
ebf484d
Compare
5 tasks
5 tasks
libanki:testutils, migrate TestClass and rename TestClass to AnkiTestTestClass and rename TestClass to AnkiTest
ebf484d to
e28220f
Compare
5 tasks
`com.ichi2.testutils.TestClass` => `com.ichi2.anki.libanki.testutils.TestClass` No Android/AnkiDroid references allow this to occur Rationale: Most of the libanki tests rely on `JvmTest`, which relies on `TestClass` This is the next step in moving these tests across to `libanki` which should speed up our test process Issue 18015
`com.ichi2.anki.libanki.testutils.TestClass` `com.ichi2.anki.libanki.testutils.AnkiTest` This is now for 'LibAnki' only, enforced by the module the name makes the intention of the class much more clear
e28220f to
edeffd2
Compare
mikehardy
approved these changes
Jul 20, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Most of
libankitesting requiresJvmTestJvmTestuses theAnkiTestinterfaceRobolectricTestuses theAnkiTestinterfaceIn order to move
JvmTestout ofAnkiDroidand into somethinglibankican use, we first need to moveAnkiTestAnkiTestmust be usable bylibanki/testandAnkiDroid/test, so define a new module:libanki:testutilsto avoid a circular dependency, without exposing test-related classes to the non-test AnkiDroid.Then, break up the dependencies, and move
AnkiTestand a few dependencies tolibanki:testutilsFixes
How Has This Been Tested?
Unit test only
I haven't checked
AndroidTest, will trust CILearning
This is not fun, but it's nearly over
Context Parameters would be useful architecturally, soon... 😆
Checklist