Re: How to use a plexus component inside a maven report ?
On Sat, 31 May 2014 14:22:13 +0200 Hervé BOUTEMY herve.bout...@free.fr wrote: Le samedi 31 mai 2014 13:55:47 Hervé BOUTEMY a écrit : logical, finally: why would the plugin classpath contain actual project? And since resolution happens from workspace, I imagine that the plugin can get classes just after compile phase, isn't it? s/workspace/reactor/ So for you, this is the good way to do it ? I would not mind to create a new lookup realm for plexus container to include the module target/classes. I tried this but it did not work either. I would just need a little help on this code. If someone could point me where to look, ... I would really that the report do his internal cooking instead of adding configuration in the pom.xml. thanks, tony. Regards, Hervé Le samedi 31 mai 2014 12:46:34 Tony Chemit a écrit : On Sat, 31 May 2014 11:19:57 +0200 Hervé BOUTEMY herve.bout...@free.fr wrote: you mean you're trying to do something like plexus:components-report [1]? Yes are you sure you generated the plexus descriptor before running the mojo injecting implementations? Yes, project/target/classes/META-INF/plexus/components.xml is there. The maven plugin is here: http://svn.nuiton.org/eugene/trunk/eugene-maven-plugin/src/main/java/org/n ui ton/eugene/plugin/AbstractEugeneReport.java http://svn.nuiton.org/eugene/trunk/eugene-maven-plugin/src/main/java/org/n u iton/eugene/plugin/TagValueReport.java I managed to use it adding this configuration in the pluginManagement plugin groupIdorg.nuiton.eugene/groupId artifactIdeugene-maven-plugin/artifactId dependencies dependency groupId${project.groupId}/groupId artifactId${project.artifactId}/artifactId version${project.version}/version /dependency /dependencies /plugin but it look a bit strange to do this, plus it won't work if the project was never built... Regards, Hervé [1] http://plexus.codehaus.org/plexus-maven-plugin/components-report-mojo.ht m l Le samedi 31 mai 2014 10:05:06 Tony Chemit a écrit : Hi, Let me explain my problem, hopes to find here a solution about it. I am currently writing a maven report to describe some plexus components. The idea is to be able to describe the components declared in the very same maven module. I tried this, it found components of the same role from the dependencies, but not the one declared in the module : @org.apache.maven.plugins.annotations.Component(role = TagValueDefinitionProvider.class) protected MapString, TagValueDefinitionProvider tagValueProviders; What did I miss ? Thanks for any help. tony. - To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org For additional commands, e-mail: dev-h...@maven.apache.org - To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org For additional commands, e-mail: dev-h...@maven.apache.org - To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org For additional commands, e-mail: dev-h...@maven.apache.org -- Tony Chemit tél: +33 (0) 2 40 50 29 28 http://www.codelutin.com email: che...@codelutin.com twitter: https://twitter.com/tchemit - To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org For additional commands, e-mail: dev-h...@maven.apache.org
Re: Extend surefire to rerun failing tests
My first approach would also be to handle this in the test framework, e.g. using the JUnit Rules as Kristian already suggested. There you can decide on a much more fine-grained level what you want to do in case of a failing test: re-run all the tests of the class? Or only those test cases that failed? Perform the re-run of a test case immediately, or after the other tests in the same class were executed? 2014-05-28 21:43 GMT+02:00 Kristian Rosenvold kristian.rosenv...@gmail.com : I would really like to see and understand properly how this would collaborate with JUnit rules for retries. I suspect there might be some interesting issues regarding reporting (i.e. can the existing logic handle reporting of n different executions of a single test). How does this explode i parallel junit is selected :) ? Technically you can just pass a system property from your pom and into the surefire fork with the number of retries, you can read this proprety in the junit rule. I really think you should start with this approach and flesh out the details from there. It might turn out this is all you need, or that some other entirely unforseen issues pop up. As for the actual property in the plugin, I really think we should see where this leads before deciding on how to do this. On a similar note, I know some people with large corporate clouds sometimes run a test on 1 different nodes in parallel, to investigate if there is any kind of 1/1 type failures, just to be able to summarize in 20 seconds instead of 1 linear runs. This might also be another one of those cases where we could consider picking up user-written code from the test classpath; but I think I need another year thinking about that :) Kristian 2014-05-28 19:58 GMT+02:00 Jason van Zyl ja...@takari.io: I personally don't see an issue with those feature additions, but Kristian does the lions share of the work on the Surefire plugin so it would be his call. I would definitely support the additions of those features and would help test. On May 28, 2014, at 1:46 PM, Qingzhou Luo qingzhou...@google.com wrote: Hi Jason, Thanks for your reply. We plan to first extend surefire, so users can put a boolean parameter rerunFailintTests and an int parameter rerunFailintTestsCount, to tell surefire whether to rerun failing tests immediately after they fail. If a test passes in any of those reruns if will be marked as pass, but all the failing attempts will still be recorded and may be presented to users in a different way. We plan to finish everything in next 1-2 months. So we wonder would you be willing to accept our contribution in the end, and patch our code into surefire? Thanks, Qingzhou On Wed, May 28, 2014 at 5:41 AM, Jason van Zyl ja...@takari.io wrote: On May 27, 2014, at 1:14 PM, Qingzhou Luo qingzhou...@google.com wrote: Hi, I am an intern at Google. The first step of my internship project is to add the ability to Maven to automatically rerun failing tests a few times, to see if they ever pass in any of the reruns. It is useful because in many cases a test fails because it is flaky, not because there is a bug in the new source code change. I think generally being able to re-run failed tests is useful. I use this feature in the IDE all the time in a fail/fix/run/repeat scenario. If you're trying to identify flaky tests I think that's useful especially if you can collect statistics. While In the long term you may not want to rely on the re-running of failed tests that later succeed without alteration as the basis for good testing, but it's a good identification tool, but a useful feature in its own right. We think the right way to achieve this is to modify surefire plugin of maven. We want to add it as a part of the configuration of surefire, so users can decide whether they want to enable this feature, and how many times they want to rerun failing tests. We plan to open-source our contribution, and hopefully can merge our code into surefire master branch in the end. Therefore, we are wondering do you have any comments/suggestions/opinions regarding this? We appreciate any input. Maybe a simple mechanism where you store the failed tests in a file and then have a flag to run only the failed tests. I think this would be very useful. Then possible a small, configurable loop around the main execution of tests if you wanted to specify how many times to run the tests. Thank you very much! Regards, Qingzhou Thanks, Jason -- Jason van Zyl Founder, Apache Maven http://twitter.com/jvanzyl http://twitter.com/takari_io - The modern conservative is engaged in one of man's oldest exercises in moral philosophy; that is, the search for a superior moral justification for selfishness.
Re: How to use a plexus component inside a maven report ?
plexus:components-report is not much used AFAIK, I don't even know what it prints :) I don't know what you expect to write in the report. Regarding how to do it, In plexus:components-report and plugin-tools, the report is not done by loading Mojos but by reading the generated descriptor and displaying info. What type of information are you expecting to report that requires loading classes? Notice: i'm interested, because plugin-tools could perhaps do something similar for complex type parameters Regards, Hervé Le dimanche 1 juin 2014 09:46:20 Tony Chemit a écrit : On Sat, 31 May 2014 14:22:13 +0200 Hervé BOUTEMY herve.bout...@free.fr wrote: Le samedi 31 mai 2014 13:55:47 Hervé BOUTEMY a écrit : logical, finally: why would the plugin classpath contain actual project? And since resolution happens from workspace, I imagine that the plugin can get classes just after compile phase, isn't it? s/workspace/reactor/ So for you, this is the good way to do it ? I would not mind to create a new lookup realm for plexus container to include the module target/classes. I tried this but it did not work either. I would just need a little help on this code. If someone could point me where to look, ... I would really that the report do his internal cooking instead of adding configuration in the pom.xml. thanks, tony. Regards, Hervé Le samedi 31 mai 2014 12:46:34 Tony Chemit a écrit : On Sat, 31 May 2014 11:19:57 +0200 Hervé BOUTEMY herve.bout...@free.fr wrote: you mean you're trying to do something like plexus:components-report [1]? Yes are you sure you generated the plexus descriptor before running the mojo injecting implementations? Yes, project/target/classes/META-INF/plexus/components.xml is there. The maven plugin is here: http://svn.nuiton.org/eugene/trunk/eugene-maven-plugin/src/main/java/o rg/n ui ton/eugene/plugin/AbstractEugeneReport.java http://svn.nuiton.org/eugene/trunk/eugene-maven-plugin/src/main/java/o rg/n u iton/eugene/plugin/TagValueReport.java I managed to use it adding this configuration in the pluginManagement plugin groupIdorg.nuiton.eugene/groupId artifactIdeugene-maven-plugin/artifactId dependencies dependency groupId${project.groupId}/groupId artifactId${project.artifactId}/artifactId version${project.version}/version /dependency /dependencies /plugin but it look a bit strange to do this, plus it won't work if the project was never built... Regards, Hervé [1] http://plexus.codehaus.org/plexus-maven-plugin/components-report-moj o.ht m l Le samedi 31 mai 2014 10:05:06 Tony Chemit a écrit : Hi, Let me explain my problem, hopes to find here a solution about it. I am currently writing a maven report to describe some plexus components. The idea is to be able to describe the components declared in the very same maven module. I tried this, it found components of the same role from the dependencies, but not the one declared in the module : @org.apache.maven.plugins.annotations.Component(role = TagValueDefinitionProvider.class) protected MapString, TagValueDefinitionProvider tagValueProviders; What did I miss ? Thanks for any help. tony. - To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org For additional commands, e-mail: dev-h...@maven.apache.org - To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org For additional commands, e-mail: dev-h...@maven.apache.org - To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org For additional commands, e-mail: dev-h...@maven.apache.org - To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org For additional commands, e-mail: dev-h...@maven.apache.org
Re: How to use a plexus component inside a maven report ?
On Sun, 01 Jun 2014 16:54:54 +0200 Hervé BOUTEMY herve.bout...@free.fr wrote: plexus:components-report is not much used AFAIK, I don't even know what it prints :) I don't know what you expect to write in the report. Hum you may have misundertood me. I just want to get some plexus components, and do my stuff on it. Plexus *was* just the way until recently to get components in mojo. Regarding how to do it, In plexus:components-report and plugin-tools, the report is not done by loading Mojos but by reading the generated descriptor and displaying info. No not my point to show stuff about plexus component, just want any instance of a role. What type of information are you expecting to report that requires loading classes? Everything :) More seriously, I need to call some methods on each components to get what I want to report. The @Component on a MapString, X is exaclty what I need, but still can't find out how to make the mojo also take account of the components of the maven project. Perharps is there is simplier way to do this now with guice ? I thing this could be the solution. Notice: i'm interested, because plugin-tools could perhaps do something similar for complex type parameters No problem, let's find a nice solution to do this :) tony. -- Tony Chemit tél: +33 (0) 2 40 50 29 28 http://www.codelutin.com email: che...@codelutin.com twitter: https://twitter.com/tchemit - To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org For additional commands, e-mail: dev-h...@maven.apache.org
Re: How to use a plexus component inside a maven report ?
Le dimanche 1 juin 2014 18:53:12 Tony Chemit a écrit : On Sun, 01 Jun 2014 16:54:54 +0200 Hervé BOUTEMY herve.bout...@free.fr wrote: plexus:components-report is not much used AFAIK, I don't even know what it prints :) I don't know what you expect to write in the report. Hum you may have misundertood me. I just want to get some plexus components, and do my stuff on it. Plexus *was* just the way until recently to get components in mojo. ok so adding the current project to plugin dependencies is the way to go: not usual, but it's really what you are requiring, ie inject current project to plugin's classpath for it to access Plexus components declared by current project and it should work even if current project hasn't been installed yet, since reactor content can be resolved just after compilation step you just need to take care at which phase you'll run your plugin Regarding how to do it, In plexus:components-report and plugin-tools, the report is not done by loading Mojos but by reading the generated descriptor and displaying info. No not my point to show stuff about plexus component, just want any instance of a role. What type of information are you expecting to report that requires loading classes? Everything :) More seriously, I need to call some methods on each components to get what I want to report. The @Component on a MapString, X is exaclty what I need, but still can't find out how to make the mojo also take account of the components of the maven project. Perharps is there is simplier way to do this now with guice ? I thing this could be the solution. Notice: i'm interested, because plugin-tools could perhaps do something similar for complex type parameters No problem, let's find a nice solution to do this :) it seems you're not doing at all what I expected, so I doubt this can be reused for plugin-tools any idea on how to dicument complex types parameters in plugin documentation is welcome... Regards, Hervé tony. - To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org For additional commands, e-mail: dev-h...@maven.apache.org
[GitHub] maven pull request: [MNG-4565] Multiple profile activation conditi...
Github user jvanzyl commented on the pull request: https://github.com/apache/maven/pull/16#issuecomment-44797771 I created a simple shell script to help validate a pull request against the Maven integration tests. This script is not great, and running the Maven integration tests is not exactly straight forward but this is a step in the right direction. Here is the shell script: https://gist.github.com/jvanzyl/16da25976f8ad27293fa Save the file to something like `maven-pr-validator.sh` and you run it by providing the PR #. So in your case you will run it as `maven-pr-validator.sh 16` and this will check out Maven, apply your patch, build Maven, check out the integration tests and run them against the just-build Maven. You will see that one of the integration tests is broken as a result of the patch. I will help you debug and fix it. This is not ideal but it's a step in the right direction in helping interested users vet their contributions automatically. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org For additional commands, e-mail: dev-h...@maven.apache.org
Maven core contributors validator their changes against the integration tests
Hi, There have been a lot of great patches for Maven core recently which is a pleasant surprise. Unfortunately it's not readily apparent to contributors what is required to accept a patch into core. Not only must the unit tests pass, but the integration tests must pass as well. Our integration tests catch most things and we're in a state where much of what should be tested in the unit tests are only captured in the integration tests. This is not a horrible thing in and of itself but it makes it fairly time consuming to test for non-core developers. I don't think most people even know we have an integration test suite or where they are. While not perfect, until we have automation to validate changes, I created a shell script to help those making changes to core more easily see if their changes have broken anything: https://gist.github.com/jvanzyl/16da25976f8ad27293fa If you have made a pull request, this script will apply your PR as a patch to master, build Maven and then use the just-built Maven to run the integration tests. If this script succeeds it becomes an order of magnitude easier to review the change knowing nothing is broken. This is not to say your patch will be immediately accepted if everything passes but it helps contributors to know nothing is broken which makes looking at a patch far more appealing to the core developers. Thanks, Jason -- Jason van Zyl Founder, Apache Maven http://twitter.com/jvanzyl http://twitter.com/takari_io - A party which is not afraid of letting culture, business, and welfare go to ruin completely can be omnipotent for a while. -- Jakob Burckhardt