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

maven工程下使用mvn clean test执行自动生成的测试用例,jacoco无法统计到覆盖率 #8

Open
zhangdalao opened this issue Nov 22, 2022 · 1 comment

Comments

@zhangdalao
Copy link

Context

Please provide below a detailed introduction to the issue itself, and describe what you were doing when the issue happened. Or, what do you want to achieve?

Steps to Reproduce

Please break down here below all the needed steps to reproduce the issue.
[If possible, please upload an example of the project you are generating tests for.]

SmartUt Arguments

Please provide the whole SmartUt commmand you executed (if relevant)

Current Result

Please describe here below the current result you got (if relevant)
[if relevant, include a screenshot]

Expected result

Please describe here below what should be the expected behaviour (if relevant)

Additional info

Please add any information of interest here below

@zhangdalao zhangdalao changed the title maven工程下使用mvn cleasn maven工程下使用mvn clean test执行自动生成的测试用例,jacoco无法统计到覆盖率 Nov 22, 2022
@Heyres
Copy link

Heyres commented Apr 13, 2023

使用jacoco离线模式:

            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <version>0.7.9</version>
            <executions>
                <execution>
                    <id>prepare-unit-test</id>
                    <goals>
                        <goal>prepare-agent</goal>
                    </goals>
                    <configuration>
                        <destFile>target/jacoco/jacoco_ut.exec</destFile>
                        <propertyName>surefireArgLine</propertyName>
                    </configuration>
                </execution>
                <execution>
                    <id>post-unit-test</id>
                    <phase>test</phase>
                    <goals>
                        <goal>report</goal>
                    </goals>
                    <configuration>
                        <dataFile>target/jacoco/jacoco_ut.exec</dataFile>
                        <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory>
                    </configuration>
                </execution>
                <execution>
                    <id>pre-integration-test</id>
                    <phase>pre-integration-test</phase>
                    <goals>
                        <goal>prepare-agent</goal>
                    </goals>
                    <configuration>
                        <destFile>target/jacoco/jacoco-it.exec</destFile>
                        <propertyName>failsafeArgLine</propertyName>
                    </configuration>
                </execution>
                <execution>
                    <id>post-integration-test</id>
                    <phase>post-integration-test</phase>
                    <goals>
                        <goal>report</goal>
                    </goals>
                    <configuration>
                        <dataFile>target/jacoco/jacoco-it.exec</dataFile>
                        <outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory>
                    </configuration>
                </execution>
            </executions>
        </plugin>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants