Skip to content

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

Merged
olamy merged 9 commits into
mojohaus:masterfrom
cachescrubber:gh-1016
Nov 16, 2023
Merged

Align update-parent and display-parent-update#1017
olamy merged 9 commits into
mojohaus:masterfrom
cachescrubber:gh-1016

Conversation

@cachescrubber

Copy link
Copy Markdown
Contributor

Resolves #1016

@cachescrubber

Copy link
Copy Markdown
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
Copy Markdown
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.

@andrzejj0

Copy link
Copy Markdown
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!

@andrzejj0

Copy link
Copy Markdown
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

cachescrubber commented Nov 12, 2023

Copy link
Copy Markdown
Contributor Author

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

@andrzejj0

Copy link
Copy Markdown
Contributor

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

@olamy
olamy merged commit e56c8c4 into mojohaus:master Nov 16, 2023
@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