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

"Run with AppMap" did not record AppMaps for "gradle check" #387

Open
jansorg opened this issue Aug 31, 2023 · 0 comments
Open

"Run with AppMap" did not record AppMaps for "gradle check" #387

jansorg opened this issue Aug 31, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@jansorg
Copy link
Collaborator

jansorg commented Aug 31, 2023

https://github.com/monogon-dev/intellij-cue has a run configuration to run tests via gradle check.
When I execute this configuration with "Run with AppMap", then no AppMaps are recorded. When I execute task "test", then AppMaps are recorded.

Update:
The cause is that IntelliJ generates a Gradle init script, which only adds the JVM arguments for the specified tests and not for the dependencies of these test:

//-- Generated by org.jetbrains.plugins.gradle.service.project.JavaGradleProjectResolver
gradle.taskGraph.whenReady { taskGraph ->
  taskGraph.allTasks.each { Task task ->
    if (task instanceof JavaForkOptions && (["clean", "check"].contains(task.name) || ["clean", "check"].contains(task.path))) {
        def jvmArgs = task.jvmArgs.findAll{!it?.startsWith('-agentlib:jdwp') && !it?.startsWith('-Xrunjdwp')}
        jvmArgs << "-Dappmap.config.file=/home/jansorg/temp/appmap/intellij-cue/appmap.yml" << "-Dappmap.output.directory=/home/jansorg/temp/appmap/intellij-cue/build/appmap" << "-javaagent:/home/jansorg/.appmap/lib/java/appmap.jar"
        task.jvmArgs = jvmArgs
    }
  }
}
@jansorg jansorg added the bug Something isn't working label Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant