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

Migrate the non-UI tests from JUnit 4 to 5 #1456

Merged
merged 23 commits into from
Jan 28, 2023
Merged

Migrate the non-UI tests from JUnit 4 to 5 #1456

merged 23 commits into from
Jan 28, 2023

Conversation

mkondratek
Copy link
Collaborator

No description provided.

@mkondratek mkondratek self-assigned this Jan 17, 2023
@mkondratek mkondratek linked an issue Jan 17, 2023 that may be closed by this pull request
@@ -10,7 +10,7 @@ import org.virtuslab.ideprobe.ProbeDriver
object UIScenarioSuite extends UISuite {}

@RunWith(classOf[JUnit4])
Copy link
Collaborator Author

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.

Copy link
Collaborator

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 🤔

Copy link
Collaborator

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

Copy link
Collaborator

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

@mkondratek mkondratek marked this pull request as ready for review January 17, 2023 16:19
@@ -8,16 +8,16 @@

import lombok.SneakyThrows;

public abstract class BaseGitRepositoryBackedIntegrationTestSuite {
public class GitRepositoryBackedIntegrationTestSuiteInitializer {
Copy link
Collaborator

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?

Copy link
Collaborator

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.

Copy link
Collaborator Author

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.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Renamed to just TestGitRepository

@PawelLipski PawelLipski added testing Relates to tests and testability code quality Code quality labels Jan 19, 2023
@PawelLipski PawelLipski added this to the v3.4.0 milestone Jan 19, 2023
PawelLipski
PawelLipski previously approved these changes Jan 19, 2023
@PawelLipski
Copy link
Collaborator

Hmmm actually this doesn't need to depend on rename feature, can go directly to develop... lemme take it over & retarget. Later I'll reconcile these changes with #1460 which adds a non-trivial use of PowerMock

@PawelLipski PawelLipski marked this pull request as ready for review January 27, 2023 16:07
@PawelLipski PawelLipski force-pushed the refactor/arch-unit-prod-classes branch from ea4b9f4 to 4f09e02 Compare January 28, 2023 16:04
Base automatically changed from refactor/arch-unit-prod-classes to develop January 28, 2023 16:35
Copy link
Collaborator Author

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


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.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

można? można!

@PawelLipski PawelLipski merged commit 09c022d into develop Jan 28, 2023
@PawelLipski PawelLipski deleted the chore/junit-5 branch January 28, 2023 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code quality Code quality testing Relates to tests and testability
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate the non-UI tests from JUnit 4 to 5
2 participants