-
Notifications
You must be signed in to change notification settings - Fork 17
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
Migrate the non-UI tests from JUnit 4 to 5 #1456
Conversation
branchLayout/api/src/test/java/com/virtuslab/branchlayout/api/BranchLayoutTestSuite.java
Outdated
Show resolved
Hide resolved
branchLayout/api/src/test/java/com/virtuslab/branchlayout/api/BranchLayoutTestSuite.java
Outdated
Show resolved
Hide resolved
branchLayout/api/src/test/java/com/virtuslab/branchlayout/api/BranchLayoutTestSuite.java
Outdated
Show resolved
Hide resolved
branchLayout/api/src/test/java/com/virtuslab/branchlayout/api/BranchLayoutTestSuite.java
Outdated
Show resolved
Hide resolved
@@ -10,7 +10,7 @@ import org.virtuslab.ideprobe.ProbeDriver | |||
object UIScenarioSuite extends UISuite {} | |||
|
|||
@RunWith(classOf[JUnit4]) |
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.
here the stairs are starting
@PawelLipski, is it true that all non ui tests are now migrated to junit 5?
If so, maybe let's try to get it merged and I will try to deliver junit 5 in ui tests later.
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.
Yeah, looks like that indeed 🤔
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.
I've extracted VirtusLab/ide-probe#337 and #1464 for that
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.
And narrowed down #1365 to non-UI tests explicitly
a8d7c03
to
8339f7f
Compare
@@ -8,16 +8,16 @@ | |||
|
|||
import lombok.SneakyThrows; | |||
|
|||
public abstract class BaseGitRepositoryBackedIntegrationTestSuite { | |||
public class GitRepositoryBackedIntegrationTestSuiteInitializer { |
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.
Is it the final form of this class? or has sth been retained just for the sake of supporting junit4 in UI tests?
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.
Also... I'd simplify the name of this class. I'd argue that it theoretically doesn't need to be used to "back" any "integration test suite". It really just wraps a git repo prepared from the given script in a temp directory.
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.
before parameters were used to construct the test classes - I think that the parameters functionality was overused there. JUnit 5 more strictly requires that parameters are for test methods (cases).
It is still needed for ui tests - that's true. but I think some improvements (esp naming) can be applied even though ui tests leave with junit 4 for now.
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.
Renamed to just TestGitRepository
8339f7f
to
59d8eb9
Compare
...java/com/virtuslab/gitmachete/backend/integration/StatusAndDiscoverIntegrationTestSuite.java
Outdated
Show resolved
Hide resolved
59d8eb9
to
913df95
Compare
913df95
to
814eb2f
Compare
7fc948b
to
471466f
Compare
814eb2f
to
af33625
Compare
471466f
to
c5c0d37
Compare
c1922e9
to
fbe7b10
Compare
eecaff0
to
3447023
Compare
fbe7b10
to
ed0186a
Compare
3e4d7d0
to
65634b4
Compare
Hmmm actually this doesn't need to depend on rename feature, can go directly to |
ed0186a
to
2f2aa80
Compare
ea4b9f4
to
4f09e02
Compare
- buildSrc
- branchLayout
- gitCore
- frontend:ui
- frontend:resourcebundles
- testCommon
- backend
- uiTest (modified but not migrated yet)
- drop junit 4
- revamp GitCoreRepositoryTest into integration test
…`@NonInjectable`
c80da1b
to
60c05a2
Compare
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.
approving my own PR ✅ next time I find a use case for power mock I reconsider my code first XD
on the other hand - extracting some classes (submitter info, aux), think a bit, and it can be dropped !
branchLayout/api/src/test/java/com/virtuslab/branchlayout/api/BranchLayoutTestSuite.java
Show resolved
Hide resolved
...ab/gitmachete/backend/unit/GitMacheteRepository_deriveParentAwareForkPointUnitTestSuite.java
Show resolved
Hide resolved
...ab/gitmachete/backend/unit/GitMacheteRepository_deriveParentAwareForkPointUnitTestSuite.java
Show resolved
Hide resolved
|
||
val gitCoreRepository = new GitCoreRepository(it.rootDirectoryPath, it.mainGitDirectoryPath, it.worktreeGitDirectoryPath); | ||
// Let's check against a non-existent commit. | ||
// No exception should be thrown, just a null returned. |
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.
można? można!
No description provided.