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

Repacked the intellij-agent artifact to kover-jvm-agent #550

Merged
merged 5 commits into from
Feb 29, 2024
Merged

Conversation

shanshin
Copy link
Collaborator

User can use the JVM agent separately, with the name kover and without mentioning IntelliJ, as well as reduce the number of parameters and properties required to transfer to the agent.

Now Kover Gradle Plugin uses kover-jvm-agent with the same version. To do this, the transfer of staging repositories was added to the functional tests. The common logic of publishing was also extracted into a separate convention plugin.

Resolves #464

Copy link
Member

@sandwwraith sandwwraith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the Kover agent is supposed to be used by end users, some documentation for it is needed (at least for argsfile setup)

kover-cli/build.gradle.kts Show resolved Hide resolved
// no-op
}

public static boolean isBoolean(String value) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can safely move this to KoverJvmAgentPremain without creating unnecessary utils class

} else if (line.length() == 0) {
// skip empty line
} else {
throw new IllegalArgumentException("Unrecognized line in Kover arguments file: " + line);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If args file is supposed to be filled by user (and from commit message I suppose it is), it would be nice to mention in the exception what valid values are. E.g. Line must start with one of prefixes: ${listOf(FILE_PATH_ATTRIBUTE, APPEND_ATTRIBUTE, ...}

settings.gradle.kts Outdated Show resolved Hide resolved
@shanshin shanshin requested a review from sandwwraith February 27, 2024 19:23
User can use the JVM agent separately, with the name kover and without mentioning IntelliJ, as well as reduce the number of parameters and properties required to transfer to the agent.

Now Kover Gradle Plugin uses kover-jvm-agent with the same version. To do this, the transfer of staging repositories was added to the functional tests.
The common logic of publishing was also extracted into a separate convention plugin.

Resolves #464
## Getting a readable report
To get a readable coverage report, you need to:
1. [Connect JVM agent on JVM start](#connecting-the-jvm-agent)
2. Terminate the JVM application. When application finished, the binary report file will be saved
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
2. Terminate the JVM application. When application finished, the binary report file will be saved
2. Run your JVM application and wait until it exits. When the application is finished, the binary report file will be saved.

(also add dots for other items)

kover-jvm-agent/docs/index.md Outdated Show resolved Hide resolved
## Kover JVM arguments file
The arguments file is a set of settings, each of which is written on a new line.
Line format: `argument_name=argument_value`

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add info like report.file argument is required, while the rest are optional.

- `exclude` - specify which classes do not need to be modified when loading. For such classes, the coverage will always be 0.

It is acceptable to use `*` and `?` wildcards, `*` means any number of arbitrary characters (including no chars), `?` means one arbitrary character.
- `exclude.regex` - specify which classes do not need to be modified when loading. For such classes, the coverage will always be 0.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is exclude.regex simply combined with exclude or something else happens? Please add info to the doc, e.g. "It is possible to use exclude and exclude.regex at the same time"


It is acceptable to specify regex.

Example of arguments file
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Example of arguments file
Example of arguments file:

@@ -0,0 +1,9 @@
package kotlinx.kover.jvmagent;

public class ParseUtils {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this file can be deleted completely

@shanshin shanshin merged commit 55ea41d into main Feb 29, 2024
1 check passed
@shanshin shanshin deleted the wrap-agent branch February 29, 2024 14:04
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

Successfully merging this pull request may close these issues.

Repack the intellij-agent artifact to kover-jvm-agent
2 participants