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

Add Maven Mojo to perform offline instrumentation #64

Merged
merged 11 commits into from Jan 15, 2013

Conversation

Projects
None yet
3 participants
@Godin
Member

Godin commented Jan 4, 2013

No description provided.

@stephanenicolas

This comment has been minimized.

Show comment
Hide comment
@stephanenicolas

stephanenicolas Jan 2, 2013

Where can we learn how to use Jacoco with offline instrumentation ? I would like to try it on an android project ?

stephanenicolas commented Jan 2, 2013

Where can we learn how to use Jacoco with offline instrumentation ? I would like to try it on an android project ?

@Godin

This comment has been minimized.

Show comment
Hide comment
@Godin

Godin Jan 2, 2013

Member

Version 0.6.2 which supports offline instrumentation is still in development, so things can dramatically change and that's why there is no public and official information on how to do this. But if you want to do some experiments with trunk, then discussion in #58 might be interesting for you.

Member

Godin commented Jan 2, 2013

Version 0.6.2 which supports offline instrumentation is still in development, so things can dramatically change and that's why there is no public and official information on how to do this. But if you want to do some experiments with trunk, then discussion in #58 might be interesting for you.

@stephanenicolas

This comment has been minimized.

Show comment
Hide comment
@stephanenicolas

stephanenicolas Jan 2, 2013

I don't feel confortable enough to start from scratch. But if you need someone to test the documentation when it is ready, please notify me.

Thx for your work,
Stéphane

stephanenicolas commented Jan 2, 2013

I don't feel confortable enough to start from scratch. But if you need someone to test the documentation when it is ready, please notify me.

Thx for your work,
Stéphane

@Godin

This comment has been minimized.

Show comment
Hide comment
@Godin

Godin Jan 2, 2013

Member

Ok, cool! I'll keep this in mind.

Member

Godin commented Jan 2, 2013

Ok, cool! I'll keep this in mind.

@Godin

This comment has been minimized.

Show comment
Hide comment
@Godin

Godin Jan 11, 2013

Member

@marchof Could you please review those changes?

Member

Godin commented Jan 11, 2013

@marchof Could you please review those changes?

@marchof

This comment has been minimized.

Show comment
Hide comment
@marchof

marchof Jan 12, 2013

Member

@Godin I will have a closer look at it tomorrow!

Member

marchof commented Jan 12, 2013

@Godin I will have a closer look at it tomorrow!

<version>4.10</version>
<scope>test</scope>
</dependency>
<dependency>

This comment has been minimized.

@marchof

marchof Jan 13, 2013

Member

This is a important step to provide the agent runtime here. Should we add a comment?

@marchof

marchof Jan 13, 2013

Member

This is a important step to provide the agent runtime here. Should we add a comment?

This comment has been minimized.

@Godin

Godin Jan 14, 2013

Member

Done in 309ab4c

@Godin

Godin Jan 14, 2013

Member

Done in 309ab4c

@marchof

This comment has been minimized.

Show comment
Hide comment
@marchof

marchof Jan 13, 2013

Member

@Godin I feel like we should add a warning like this to the offline goals (also for the Ant task). The problem is that people migrating from other tools will expect an instrumentation step and might actually use this without any reason.

Warning: The preferred way for code coverage analysis with JaCoCo is on-the-fly instrumentation. Offline instrumentation has several drawbacks and should only be used if a specific scenario explicitly requires this mode. Please consult documentation about offline instrumentation before using this mode.

Member

marchof commented Jan 13, 2013

@Godin I feel like we should add a warning like this to the offline goals (also for the Ant task). The problem is that people migrating from other tools will expect an instrumentation step and might actually use this without any reason.

Warning: The preferred way for code coverage analysis with JaCoCo is on-the-fly instrumentation. Offline instrumentation has several drawbacks and should only be used if a specific scenario explicitly requires this mode. Please consult documentation about offline instrumentation before using this mode.

@marchof

This comment has been minimized.

Show comment
Hide comment
@marchof

marchof Jan 13, 2013

Member

@Godin Minor comment about wording: I used "offline instrumentation" in documentation in lower case, you use upper case spelling. As "on-the-fly" is also lowercase I would prefer the lower case spelling.

Member

marchof commented Jan 13, 2013

@Godin Minor comment about wording: I used "offline instrumentation" in documentation in lower case, you use upper case spelling. As "on-the-fly" is also lowercase I would prefer the lower case spelling.

@marchof

This comment has been minimized.

Show comment
Hide comment
@marchof

marchof Jan 13, 2013

Member

@Godin Is it possible and reasonable to have a single goal 'instrument' which does also the cleanup job? I.e. have this goal bound to two phases by default?

Member

marchof commented Jan 13, 2013

@Godin Is it possible and reasonable to have a single goal 'instrument' which does also the cleanup job? I.e. have this goal bound to two phases by default?

@Godin

This comment has been minimized.

Show comment
Hide comment
@Godin

Godin Jan 14, 2013

Member

@marchof Not possible to bind the same goal to two phases by default, moreover this separation is required for support of Android.

Warning about offline instrumentation looks like a good idea for me - should I add it?

The rest has been fixed.

Member

Godin commented Jan 14, 2013

@marchof Not possible to bind the same goal to two phases by default, moreover this separation is required for support of Android.

Warning about offline instrumentation looks like a good idea for me - should I add it?

The rest has been fixed.

@marchof

This comment has been minimized.

Show comment
Hide comment
@marchof

marchof Jan 14, 2013

Member

@Godin Ok, please add the warning to the Maven goals, I'll add it to the Ant task on master.

Member

marchof commented Jan 14, 2013

@Godin Ok, please add the warning to the Maven goals, I'll add it to the Ant task on master.

@Godin

This comment has been minimized.

Show comment
Hide comment
@Godin

Godin Jan 14, 2013

Member

@marchof Warning has been added, so can I merge?

Member

Godin commented Jan 14, 2013

@marchof Warning has been added, so can I merge?

@marchof

This comment has been minimized.

Show comment
Hide comment
@marchof

marchof Jan 14, 2013

Member

@Godin Go for it ;-)

Member

marchof commented Jan 14, 2013

@Godin Go for it ;-)

Godin added a commit that referenced this pull request Jan 15, 2013

Merge pull request #64 from jacoco/issue-64
Add Maven Mojos to perform offline instrumentation

@Godin Godin merged commit 3c1cb3d into master Jan 15, 2013

1 check passed

default The Travis build passed
Details

@Godin Godin deleted the issue-64 branch Jan 15, 2013

@stephanenicolas

This comment has been minimized.

Show comment
Hide comment
@stephanenicolas

stephanenicolas Mar 24, 2013

HI @Godin ,

this thread is a bit old now but your experiment with android helped me a lot to set up a unified code coverage for both robolectric and standard junit tests and get it displayed in a sonar dash board.

(see the Jacoco profile here : https://github.com/stephanenicolas/Quality-Tools-for-Android/blob/)

  • Robolectric are considered standard unit tests.
  • standard Android Junit tests are considered as standard integration tests.
    This makes sense as Robolectric tests mock an android platform and can be considered more "unit" tests thant standard android tests because the latter needs a real android platform and relies on networking, disk, locale, etc.

I have been dreaming about that for almost a year now. Thanks a lot for offline instrumentation via jacoco :)

Do you think it would be possible to give better names to the test suites inside the widget, and even to add more test suites ? For instance I would like to add UI testing (black box testing) or monkey testing.

stephanenicolas commented Mar 24, 2013

HI @Godin ,

this thread is a bit old now but your experiment with android helped me a lot to set up a unified code coverage for both robolectric and standard junit tests and get it displayed in a sonar dash board.

(see the Jacoco profile here : https://github.com/stephanenicolas/Quality-Tools-for-Android/blob/)

  • Robolectric are considered standard unit tests.
  • standard Android Junit tests are considered as standard integration tests.
    This makes sense as Robolectric tests mock an android platform and can be considered more "unit" tests thant standard android tests because the latter needs a real android platform and relies on networking, disk, locale, etc.

I have been dreaming about that for almost a year now. Thanks a lot for offline instrumentation via jacoco :)

Do you think it would be possible to give better names to the test suites inside the widget, and even to add more test suites ? For instance I would like to add UI testing (black box testing) or monkey testing.

@Godin

This comment has been minimized.

Show comment
Hide comment
@Godin

Godin Mar 24, 2013

Member

Hi @stephanenicolas ,

No need to write the same in several topics.

We are glad to hear that our work is useful for you.

What do you mean by "widget" ? If this is about Sonar, then this is not an appropriate place to discuss this.

Member

Godin commented Mar 24, 2013

Hi @stephanenicolas ,

No need to write the same in several topics.

We are glad to hear that our work is useful for you.

What do you mean by "widget" ? If this is about Sonar, then this is not an appropriate place to discuss this.

@stephanenicolas

This comment has been minimized.

Show comment
Hide comment
@stephanenicolas

stephanenicolas Mar 25, 2013

Hi Evgeny,

you're right, I have been over enthusiastic about this :)
Sorry for having disturbed this forum. I just believed that people reaching
both threads might have been interested in this work.

By widget, I meant the Sonar widget, so you're right again, that's not the
place to talk about it.

Stéphane

2013/3/24 Evgeny Mandrikov notifications@github.com

Hi @stephanenicolas https://github.com/stephanenicolas ,

No need to write the same in several topics.

We are glad to hear that our work is useful for you.

What do you mean by "widget" ? If this is about Sonar, then this is not an
appropriate place to discuss this.


Reply to this email directly or view it on GitHubhttps://github.com//pull/64#issuecomment-15361176
.

Stéphane NICOLAS,
OCTO Technology
Développeur & Consultant Android / Java
..........................................................
50, Avenue des Champs-Elysées
75008 Paris
+33 (0)6.26.32.34.09
www.octo.com - blog.octo.com
www.usievents.com
...........................................................

stephanenicolas commented Mar 25, 2013

Hi Evgeny,

you're right, I have been over enthusiastic about this :)
Sorry for having disturbed this forum. I just believed that people reaching
both threads might have been interested in this work.

By widget, I meant the Sonar widget, so you're right again, that's not the
place to talk about it.

Stéphane

2013/3/24 Evgeny Mandrikov notifications@github.com

Hi @stephanenicolas https://github.com/stephanenicolas ,

No need to write the same in several topics.

We are glad to hear that our work is useful for you.

What do you mean by "widget" ? If this is about Sonar, then this is not an
appropriate place to discuss this.


Reply to this email directly or view it on GitHubhttps://github.com//pull/64#issuecomment-15361176
.

Stéphane NICOLAS,
OCTO Technology
Développeur & Consultant Android / Java
..........................................................
50, Avenue des Champs-Elysées
75008 Paris
+33 (0)6.26.32.34.09
www.octo.com - blog.octo.com
www.usievents.com
...........................................................

@stephanenicolas

This comment has been minimized.

Show comment
Hide comment
@stephanenicolas

stephanenicolas Oct 29, 2013

Is offline instrumentation supposed to work for android with latest release
artifact ?

It looks like :
https://github.com/Godin/jacoco-experiments/blob/android/android/app.tests/pom.xml

is not working anymore with latest jacoco release. They only worked with
the snapshot 0.6.2-SNAPSHOT, but not afterwards.

Stéphane

stephanenicolas commented Oct 29, 2013

Is offline instrumentation supposed to work for android with latest release
artifact ?

It looks like :
https://github.com/Godin/jacoco-experiments/blob/android/android/app.tests/pom.xml

is not working anymore with latest jacoco release. They only worked with
the snapshot 0.6.2-SNAPSHOT, but not afterwards.

Stéphane

@Godin

This comment has been minimized.

Show comment
Hide comment
@Godin

Godin Oct 29, 2013

Member

@stephanenicolas It supposed to work, because there is no major changes on Maven Plugin side regarding this. In any case I suggest you to switch to Users Mailing List with better explanation of your problem.

Member

Godin commented Oct 29, 2013

@stephanenicolas It supposed to work, because there is no major changes on Maven Plugin side regarding this. In any case I suggest you to switch to Users Mailing List with better explanation of your problem.

@jacoco jacoco locked and limited conversation to collaborators Jan 11, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.