Skip to content

Commit

Permalink
Configure TestJdk9 for Develocity
Browse files Browse the repository at this point in the history
Prevously, the tests that are run in the `TestJdk9` configuration were
not captured by Develocity: the results of these tests would not appear
in the Develocity test report and dashboard, and failed tests would not
be retried.

Because TestJdk9 is a custom configuration, Develocity cannot configure
it automatically and we need to manually add the Develocity test
settings in that configuration. This is done through an auto plugin that
is enabled only on projects where both the Develocity and Jdk9 plugins
are enabled.
  • Loading branch information
Duhemm committed Jun 17, 2024
1 parent cf8da61 commit a69b8f1
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion project/PekkoDevelocityPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import com.gradle.develocity.agent.sbt.DevelocityPlugin.autoImport.{
ProjectId,
Publishing
}
import sbt.{ url, AutoPlugin, Def, PluginTrigger, Plugins, Setting }
import sbt.{ inConfig, url, AutoPlugin, Def, PluginTrigger, Plugins, Setting }
import sbt.Keys.insideCI

object PekkoDevelocityPlugin extends AutoPlugin {
Expand Down Expand Up @@ -63,3 +63,15 @@ object PekkoDevelocityPlugin extends AutoPlugin {
} else apacheDevelocityConfiguration
})
}

/**
* An AutoPlugin to add Develocity test configuration to the TestJdk9 configuration.
*/
object PekkoDevelocityJdk9TestSettingsPlugin extends AutoPlugin {
override lazy val trigger: PluginTrigger = allRequirements
override lazy val requires: Plugins = DevelocityPlugin && Jdk9

// See https://docs.gradle.com/develocity/sbt-plugin/#capturing_test_data_in_a_custom_configuration
override lazy val projectSettings =
inConfig(Jdk9.TestJdk9)(DevelocityPlugin.testSettings)
}

0 comments on commit a69b8f1

Please sign in to comment.