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

Enhancement: Improved support for Jacoco Code Coverage / FISH-1447 #10

Open
tofflos opened this issue Oct 22, 2020 · 0 comments
Open

Enhancement: Improved support for Jacoco Code Coverage / FISH-1447 #10

tofflos opened this issue Oct 22, 2020 · 0 comments
Assignees
Labels
Status: Accepted Confirmed defect or accepted improvement to implement, issue has been escalated to Platform Dev Type: Enhancement Label issue as an enhancement request

Comments

@tofflos
Copy link

tofflos commented Oct 22, 2020

I'm running the Jacoco Maven plugin for code coverage which involves instrumenting my application by pointing out the location of the Jacoco agent runtime as a VM argument. The runtime location is system dependent so Jacoco comes with goals named prepare-agent and prepare-agent-integration that figures out where the runtime is located and binds that location to property called argLine. The argLine property is later picked up by Surefire and Failsafe using a feature called Late Property Evaluation. See https://www.eclemma.org/jacoco/trunk/doc/prepare-agent-mojo.html.

Unfortunately Late Property Evaluation is implemented as a feature in Surefire and Failsafe and not as a global feature in Maven so the argLine property isn't populated under Payara Micro -> Start -> JCommandLineOptions. See https://www.devwithimagination.com/2019/09/03/integration-testing-with-payara-micro to get an idea of the hoops you have to jump through to get Jacoco to work with Payara Micro.

Could you add something similar to Late Property Evaluation to the Start goal so that all you have to do is:

<plugin>
    <groupId>org.jacoco</groupId>
    <artifactId>jacoco-maven-plugin</artifactId>
    <version>0.8.6</version>
    <executions>
        <execution>
            <goals>
                <goal>prepare-agent-integration</goal>
            </goals>
        </execution>
    </executions>
</plugin>

<plugin>
    <groupId>fish.payara.maven.plugins</groupId>
    <artifactId>payara-micro-maven-plugin</artifactId>
    <version>1.3.0</version>
    <executions>
        <execution>
            <id>start-payara-micro</id>
            <phase>pre-integration-test</phase>
            <goals>
                <goal>start</goal>
            </goals>
        </execution>
        <execution>
            <id>stop-payara-micro</id>
            <phase>post-integration-test</phase>
            <goals>
                <goal>stop</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <daemon>true</daemon>
        <contextRoot>/</contextRoot>
        <javaCommandLineOptions>
            <option>
                <value>@{argLine}</value>
            </option>
        </javaCommandLineOptions>
    </configuration>
</plugin>
@fturizo fturizo transferred this issue from payara/ecosystem-maven Mar 18, 2021
@AlanRoth AlanRoth added Status: Open Issue has been triaged by the front-line engineers and is being worked on verification Type: Enhancement Label issue as an enhancement request labels Mar 22, 2021
@MeroRai MeroRai added Status: Accepted Confirmed defect or accepted improvement to implement, issue has been escalated to Platform Dev and removed Status: Open Issue has been triaged by the front-line engineers and is being worked on verification labels Apr 16, 2021
@MeroRai MeroRai changed the title Improved support for Jacoco Code Coverage ECOSYS-178 Improved support for Jacoco Code Coverage Apr 16, 2021
@JamesHillyard JamesHillyard changed the title ECOSYS-178 Improved support for Jacoco Code Coverage Enhancement: Improved support for Jacoco Code Coverage / FISH-1447 Jul 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Accepted Confirmed defect or accepted improvement to implement, issue has been escalated to Platform Dev Type: Enhancement Label issue as an enhancement request
Projects
None yet
Development

No branches or pull requests

3 participants