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

Align update-parent and display-parent-update #1017

Merged
merged 9 commits into from Nov 16, 2023

Conversation

cachescrubber
Copy link
Contributor

Resolves #1016

@cachescrubber
Copy link
Contributor Author

Of course it does not feel good to introduce duplicated code en mass, but we need to start somewhere.

  • I duplicated parameters and UpdateParentMojo#resolveTargetVersion to DisplayParentUpdatesMojo.
  • I duplicated UpdateParentMojoTest to DisplayParentUpdatesMojoTest. All tests asserting the actual updates are ignored at the moment. I need to figure out how to assert the actual console output.

@cachescrubber
Copy link
Contributor Author

I added another Test, DisplayParentUpdatesMojoOutputTest which is based on AbstractMojoTestCase like all other Display*Tests. As soon as I add a parent to my test-cases pom, test execution will fail with

java.lang.IllegalArgumentException: Invalid repository system session: LocalRepositoryManager is not set.

@jarmoniuk
Copy link
Contributor

This is coming from DefaultRepositorySystem::validateSession, which is usually called -- too bad you didn't provide a stack trace ;) -- from RepositorySystem::resolveVersion.

You either need to mock the call so that it returns what you want (see e.g. MockUtils) or just use the regular integration tests (the "it" directory).

Good luck!

@jarmoniuk
Copy link
Contributor

Hi @cachescrubber, do you need any more assistance with the failing tests?

@cachescrubber cachescrubber changed the title Draft - Align update-parent and display-parent-update Align update-parent and display-parent-update Nov 12, 2023
@cachescrubber
Copy link
Contributor Author

cachescrubber commented Nov 12, 2023

@ajarmoniuk I gave up on the *Output test. Instead, I aligned DisplayParentUpdatesMojoOutputTest (new) with UpdateParentMojoTest. Could you please review my changes?

@jarmoniuk
Copy link
Contributor

@slawekjaranowski please approve the workflow and/or raise additional PR commments.

@olamy olamy merged commit e56c8c4 into mojohaus:master Nov 16, 2023
8 checks passed
@cachescrubber cachescrubber deleted the gh-1016 branch November 20, 2023 05:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

display-parent-updates should support allowMajorUpdates, allowMinorUpdates and related parameters
4 participants