You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by or...@io7m.com on 2017/02/14 15:13:46 UTC

Running a plugin integration test from an IDE?

Hello.

I'm having a look at working on
https://issues.apache.org/jira/browse/MASSEMBLY-848 but I've never
worked on any of the "official" Maven plugins before. It seems like
the most obvious way to start working on the bug is to introduce the
files attached to that report as an integration test in the bugs
subdirectory. However, I can't work out how to run this integration
test from an IDE (Intellij IDEA, in this case) so that I can try to
step through the execution with a debugger and see what's going on.

Could somebody point me in the right direction?

M

Re: Running a plugin integration test from an IDE?

Posted by Manfred Moser <ma...@simpligility.com>.
I use the takari testing with the Android Maven Plugin all the time and it works great for me. 

Manfred

PS: also associated with Takari efforts.. 

Igor Fedorenko wrote on 2017-02-16 03:52:

> I don't use intellij, but if you are willing to try eclipse/m2e then
> there are at least two viable ways to implement "debuggable" integration
> tests. Personally I prefer takari plugin testing harness [1]
> (disclosure: I wrote the thing, so I am definitely biased).
> Alternatively, you can also use Maven Verifier [2] (this is what Maven
> core uses). Both ways to run integration tests are supported by my
> "Maven Development Tools" set of m2e extensions [3].
> 
> [1] https://github.com/takari/takari-plugin-testing-project
> [2] http://maven.apache.org/shared/maven-verifier/
> [3] https://github.com/ifedorenko/com.ifedorenko.m2e.mavendev
> 
> -- 
> Regards,
> Igor
> 
> On Thu, Feb 16, 2017, at 04:03 AM, org.apache.maven.user@io7m.com wrote:
>> On 2017-02-14T15:13:46 +0000
>> org.apache.maven.user@io7m.com wrote:
>> >
>> > I can't work out how to run this integration
>> > test from an IDE (Intellij IDEA, in this case) so that I can try to
>> > step through the execution with a debugger and see what's going on.
>> 
>> So nobody knows how to run an integration test from an IDE? How does
>> anyone debug problems via tests?
>> 
>> M
>> Email had 1 attachment:
>> + Attachment2
>>   1k (application/pgp-signature)
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Running a plugin integration test from an IDE?

Posted by or...@io7m.com.
On 2017-02-16T18:32:10 +0100
"Robert Scholte" <rf...@apache.org> wrote:

> If you have a project under maven-assembly-plugin/src/it/projects/bugs and  
> want to debug it, try:
> 
> mvn verify -Prun-its -Dinvoker.mavenExecutable=mvnDebug  
> -Dinvoker.test=projects/bugs (point to test-directory)
> 
> You'll see that Maven will hang during the invoker, at which time you have  
> to hook your IDE to it.
> 

Ah, interesting. That should do it.

Thanks!

M

Re: Running a plugin integration test from an IDE?

Posted by Robert Scholte <rf...@apache.org>.
If you have a project under maven-assembly-plugin/src/it/projects/bugs and  
want to debug it, try:

mvn verify -Prun-its -Dinvoker.mavenExecutable=mvnDebug  
-Dinvoker.test=projects/bugs (point to test-directory)

You'll see that Maven will hang during the invoker, at which time you have  
to hook your IDE to it.

Robert

http://maven.apache.org/plugins/maven-invoker-plugin/
https://dzone.com/articles/debugging-maven-build-mvndebug

On Thu, 16 Feb 2017 15:08:33 +0100, <or...@io7m.com> wrote:

> Hello!
>
> I think I may have explained myself poorly.
>
> I'm not really looking for a general way to take a project and make it
> debuggable. I'm looking for a concrete way to work on a bug in the
> Assembly plugin.
>
> On 2017-02-16T13:39:33 +0000
> John Patrick <nh...@gmail.com> wrote:
>
>> this might work and is what I get into the company/project root pom so
>> all developers can use the approach...
>
> On 2017-02-16T06:52:03 -0500
> Igor Fedorenko <ig...@ifedorenko.com> wrote:
>
>> I don't use intellij, but if you are willing to try eclipse/m2e then
>> there are at least two viable ways to implement "debuggable" integration
>> tests...
>
> I have a project that triggers the bug in the Assembly plugin, so I
> assumed that the most logical way to approach this would be to add the
> project as an integration test in here:
>
>   https://github.com/apache/maven-plugins/tree/trunk/maven-assembly-plugin/src/it/projects/bugs
>
> ... and then run the test from an IDE and step through in a debugger to
> identify the problem. I perhaps erroneously assumed that a mature
> project like this would have a simple way to run a specific test
> directly from an IDE! Is there perhaps some other way to do this that
> all of the current developers know but that isn't written down
> anywhere? I don't care how it happens, I just want to get this bug
> fixed.
>
> M

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Running a plugin integration test from an IDE?

Posted by or...@io7m.com.
Hello!

I think I may have explained myself poorly.

I'm not really looking for a general way to take a project and make it
debuggable. I'm looking for a concrete way to work on a bug in the
Assembly plugin.

On 2017-02-16T13:39:33 +0000
John Patrick <nh...@gmail.com> wrote:

> this might work and is what I get into the company/project root pom so
> all developers can use the approach...

On 2017-02-16T06:52:03 -0500
Igor Fedorenko <ig...@ifedorenko.com> wrote:

> I don't use intellij, but if you are willing to try eclipse/m2e then
> there are at least two viable ways to implement "debuggable" integration
> tests...

I have a project that triggers the bug in the Assembly plugin, so I
assumed that the most logical way to approach this would be to add the
project as an integration test in here:

  https://github.com/apache/maven-plugins/tree/trunk/maven-assembly-plugin/src/it/projects/bugs

... and then run the test from an IDE and step through in a debugger to
identify the problem. I perhaps erroneously assumed that a mature
project like this would have a simple way to run a specific test
directly from an IDE! Is there perhaps some other way to do this that
all of the current developers know but that isn't written down
anywhere? I don't care how it happens, I just want to get this bug
fixed.

M

Re: Running a plugin integration test from an IDE?

Posted by John Patrick <nh...@gmail.com>.
this might work and is what I get into the company/project root pom so
all developers can use the approach. create a debug profile and get
the tests to use is so you can debug in your preferred IDE. it doesn't
give you the nice red/green process bars and fancy output but it might
help you debug the running issue.

not tried it with the maven tests but i've used it for surefire and
failsafe before, so something like this might work for you.

1) create debug profile which is simply, and make it suspend yes so it
pauses till you connect your debugger otherwise you might miss the 1st
few tests executing
<profile>
  <id>debug</id>
  <properties>
    <testing.args.debug>-Xdebug
-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=y</testing.args.debug>
  </properties>
</profile>

2) setup a default version of the properties
<properties>
   <testing.args.debug></testing.args.debug>
</properties>

3) change the maven-surefire-plugin and maven-failsafe-plugin to use
testing.args.debug
<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-surefire-plugin</artifactId>
  ...
  <configuration>
    <argLine>... ${testing.args.debug}</argLine>
   ...
  <configuration>
  ..
</plugin>

John


On 16 February 2017 at 11:52, Igor Fedorenko <ig...@ifedorenko.com> wrote:
> I don't use intellij, but if you are willing to try eclipse/m2e then
> there are at least two viable ways to implement "debuggable" integration
> tests. Personally I prefer takari plugin testing harness [1]
> (disclosure: I wrote the thing, so I am definitely biased).
> Alternatively, you can also use Maven Verifier [2] (this is what Maven
> core uses). Both ways to run integration tests are supported by my
> "Maven Development Tools" set of m2e extensions [3].
>
> [1] https://github.com/takari/takari-plugin-testing-project
> [2] http://maven.apache.org/shared/maven-verifier/
> [3] https://github.com/ifedorenko/com.ifedorenko.m2e.mavendev
>
> --
> Regards,
> Igor
>
> On Thu, Feb 16, 2017, at 04:03 AM, org.apache.maven.user@io7m.com wrote:
>> On 2017-02-14T15:13:46 +0000
>> org.apache.maven.user@io7m.com wrote:
>> >
>> > I can't work out how to run this integration
>> > test from an IDE (Intellij IDEA, in this case) so that I can try to
>> > step through the execution with a debugger and see what's going on.
>>
>> So nobody knows how to run an integration test from an IDE? How does
>> anyone debug problems via tests?
>>
>> M
>> Email had 1 attachment:
>> + Attachment2
>>   1k (application/pgp-signature)
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Running a plugin integration test from an IDE?

Posted by Igor Fedorenko <ig...@ifedorenko.com>.
I don't use intellij, but if you are willing to try eclipse/m2e then
there are at least two viable ways to implement "debuggable" integration
tests. Personally I prefer takari plugin testing harness [1]
(disclosure: I wrote the thing, so I am definitely biased).
Alternatively, you can also use Maven Verifier [2] (this is what Maven
core uses). Both ways to run integration tests are supported by my
"Maven Development Tools" set of m2e extensions [3].

[1] https://github.com/takari/takari-plugin-testing-project
[2] http://maven.apache.org/shared/maven-verifier/
[3] https://github.com/ifedorenko/com.ifedorenko.m2e.mavendev

-- 
Regards,
Igor

On Thu, Feb 16, 2017, at 04:03 AM, org.apache.maven.user@io7m.com wrote:
> On 2017-02-14T15:13:46 +0000
> org.apache.maven.user@io7m.com wrote:
> >
> > I can't work out how to run this integration
> > test from an IDE (Intellij IDEA, in this case) so that I can try to
> > step through the execution with a debugger and see what's going on.
> 
> So nobody knows how to run an integration test from an IDE? How does
> anyone debug problems via tests?
> 
> M
> Email had 1 attachment:
> + Attachment2
>   1k (application/pgp-signature)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Running a plugin integration test from an IDE?

Posted by or...@io7m.com.
On 2017-02-14T15:13:46 +0000
org.apache.maven.user@io7m.com wrote:
>
> I can't work out how to run this integration
> test from an IDE (Intellij IDEA, in this case) so that I can try to
> step through the execution with a debugger and see what's going on.

So nobody knows how to run an integration test from an IDE? How does
anyone debug problems via tests?

M