8000
Skip to content

FrayTest plugin now works with configuration caches and ignores normal junit tests#396

Merged
aoli-al merged 1 commit intomainfrom
push-xtotmmtnztsmcmu-pasta/fray:push-xtotmmtnztsm
Mar 9, 2026
Merged

FrayTest plugin now works with configuration caches and ignores normal junit tests#396
aoli-al merged 1 commit intomainfrom
push-xtotmmtnztsm

Conversation

@aoli-al
Copy link
Copy Markdown
Member
@aoli-al aoli-al commented Mar 9, 2026

junit tests.

Copilot AI review requested due to automatic review settings March 9, 2026 18:31
Copy link
Copy Markdown
Contributor
Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the Fray Gradle plugin to be more configuration-cache friendly by removing dependency resolution from task actions, and makes frayTest run only Fray-annotated JUnit 5 tests via tagging.

Changes:

  • Refactors PrepareWorkspaceTask to accept resolved file collections/dirs as task inputs/outputs instead of resolving dependencies internally.
  • Updates Gradle plugin wiring to use detached configurations and filters JUnit Platform execution to only tests tagged FrayTest.
  • Adds @Tag("FrayTest") to Fray’s JUnit5 test template annotations and adjusts JVMTI runtime extraction behavior.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
plugins/gradle/src/main/kotlin/tasks/PrepareWorkspaceTask.kt Makes the task cache/config-cache friendlier by using FileCollection/DirectoryProperty inputs/outputs rather than resolving Dependency objects.
plugins/gradle/src/main/kotlin/FrayPlugin.kt Switches to detached configurations and configures frayTest to only run JUnit Platform tests tagged FrayTest.
plugins/base/src/main/kotlin/org/pastalab/fray/plugins/base/FrayWorkspaceInitializer.kt Changes JVMTI runtime extraction to unzip regardless of prior directory existence.
junit/src/main/kotlin/org/pastalab/fray/junit/junit5/annotations/ConcurrencyTest.kt Tags Fray annotations with FrayTest so Gradle filtering can select only Fray tests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +41 to 44
val frayWorkDir = Commons.getFrayReportDir(frayBuildFolder).toString()
val frayDebugger = target.findProperty("fray.debugger")?.toString()
val frayInstrumentationPath = frayInstrumentationJar.singleFile.absolutePath
target.dependencies.add("testImplementation", "org.pastalab.fray:fray-core:$frayVersion")
Copy link
Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

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

frayInstrumentationJar.singleFile resolves the detached configuration during configuration phase (inside afterEvaluate). This is incompatible with Gradle configuration cache and likely defeats the PR’s goal. Defer resolution to task execution (e.g., compute the javaagent path inside doFirst from a FileCollection/Provider, or wire a ConfigurableFileCollection into the task and call singleFile only at execution time).

Copilot uses AI. Check for mistakes.
Comment on lines 65 to 70
fun createJVMTiRuntime() {
if (!jvmtiPath.exists()) {
jvmtiPath.toFile().mkdirs()
unzipFile(jvmtiJar.absolutePath, jvmtiPath)
}
unzipFile(jvmtiJar.absolutePath, jvmtiPath)
}
Copy link
Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

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

createJVMTiRuntime() now unzips the JVMTI archive on every execution, even when jvmtiPath already exists. This adds unnecessary I/O and can leave stale files if the archive contents change (files removed from the new archive would remain on disk). Consider restoring a guard (e.g., only unzip when the expected library file is missing) or deleting/cleaning the output directory before extracting when you intentionally want to refresh.

Copilot uses AI. Check for mistakes.
@aoli-al aoli-al merged commit 886fbcf into main Mar 9, 2026
8 checks passed
@aoli-al aoli-al deleted the push-xtotmmtnztsm branch March 9, 2026 19: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.

2 participants

0