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

[MCOMPILER-372] - fix test compile issue: added dependency test path for modules #27

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

floison51
Copy link

@floison51 floison51 commented Dec 17, 2019

Following this checklist to help us incorporate your
contribution quickly and easily:

  • Make sure there is a JIRA issue filed
    for the change (usually before you start working on it). Trivial changes like typos do not
    require a JIRA issue. Your pull request should address just this issue, without
    pulling in other changes.
  • Each commit in the pull request should have a meaningful subject line and body.
  • Format the pull request title like [MPH-XXX] - Fixes bug in ApproximateQuantiles,
    where you replace MPH-XXX with the appropriate JIRA issue. Best practice
    is to use the JIRA issue title in the pull request title and in the first line of the
    commit message.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Run mvn clean verify to make sure basic checks pass. A more thorough check will
    be performed on your pull request automatically.
  • You have run the integration tests successfully (mvn -Prun-its clean verify).

If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement if you are unsure
please ask on the developers list.

To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.

@floison51
Copy link
Author

I added an integration test case reproducing MCOMPILER-372 test case.
Bug root case: project2 depends on project1. Both are modularized. Test compilation of project2 fails because project2 test can acceed to project 1 module but not to project 1 test class patch (i.e. project1/target/test-classes).
When this configuration is detected, project 1 test class path is added as -patchModule compiler options. All integration tests pass.

@floison51 floison51 closed this Dec 20, 2019
@floison51
Copy link
Author

Discarded, new pull request to follow

@floison51 floison51 reopened this Dec 20, 2019
@floison51
Copy link
Author

Closed by mistake.

* @param modulePathElt
* @return
*/
private File getModuleTestPathElt( File modulePathElt )
Copy link
Contributor

Choose a reason for hiding this comment

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

This methods feels a bit like best guessing. It is better to loop over all the reactorProjects to find the Paths that belong to the same Maven Project (and because of that to the same module)

@floison51
Copy link
Author

floison51 commented Jan 6, 2020 via email

path element, if it does not succeed, guess test path element from path
element
@floison51
Copy link
Author

floison51 commented Jan 7, 2020 via email

{

// Get test path from reactor projects
File result = getModuleTestPathEltFromReactorProjects( modulePathElt );
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you change this to return getModuleTestPathEltFromReactorProjects( modulePathElt );

I can't think of a reason why we need the rest of the code in this method. It would mean something went wrong somewhere else.

@floison51
Copy link
Author

floison51 commented Jan 8, 2020 via email

Prj2 was not uploading test jar to local repo.
Prj2 was not opening prj2 package.
@rfscholte
Copy link
Contributor

If you only need the reactor, please never use install anymore, but just verify. And with this plugin you should only use compile, test-compile or package (in case you depend on the jar).
I wonder if we should allow pulling in test-jars from outside the reactor. I know it is possible, but it is a codesmell to me, especially in the JPMS world. (and if overcomplicates the code)

@floison51
Copy link
Author

floison51 commented Jan 9, 2020 via email

@floison51
Copy link
Author

floison51 commented Jan 9, 2020 via email

@gnodet gnodet changed the title MCOMPILER-372 - fix test compile issue: added dependency test path for modules [MCOMPILER-372] - fix test compile issue: added dependency test path for modules Feb 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants