Skip to content

Commit

Permalink
Merge pull request #86 from ihmcrobotics/feature/add-ihmc-ci-2
Browse files Browse the repository at this point in the history
Move ihmc-ci to ihmc-build
  • Loading branch information
ds58 authored Sep 27, 2024
2 parents 4b4af74 + df4c041 commit 00efc31
Show file tree
Hide file tree
Showing 26 changed files with 1,136 additions and 3 deletions.
5 changes: 2 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ dependencies {
api("com.dorongold.plugins:task-tree:4.0.0")
api("guru.nidi:graphviz-kotlin:0.18.1")
api("com.hierynomus:sshj:0.38.0")

testApi("org.junit.jupiter:junit-jupiter-api:5.10.3")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.10.3")
api("org.junit.platform:junit-platform-launcher:1.10.3")
testImplementation("org.junit.jupiter:junit-jupiter:5.10.3")
}

tasks.withType<Test> {
Expand Down
8 changes: 8 additions & 0 deletions src/main/kotlin/us/ihmc/build/IHMCBuildPlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import org.gradle.plugins.ide.eclipse.EclipsePlugin
import org.gradle.plugins.ide.idea.IdeaPlugin
import us.ihmc.cd.AppExtension
import us.ihmc.cd.RemoteExtension
import us.ihmc.ci.IHMCCIPlugin

class IHMCBuildPlugin : Plugin<Project>
{
Expand Down Expand Up @@ -122,5 +123,12 @@ class IHMCBuildPlugin : Plugin<Project>
// IHMCBuildTools.defineExtraSourceSetCompositeTask("publishExtraSourceSets", arrayListOf("publish"), project)

IHMCBuildTools.defineDynamicCompositeTask(project)

// Apply old ihmc-ci plugin functionality
if (!project.hasProperty("isProjectGroup"))
{
val ciPlugin = IHMCCIPlugin()
ciPlugin.apply(project);
}
}
}
6 changes: 6 additions & 0 deletions src/main/kotlin/us/ihmc/ci/AllocationInstrumenter.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package us.ihmc.ci

class AllocationInstrumenter(val version: String)
{
fun instrumenter(): String = "com.google.code.java-allocation-instrumenter:java-allocation-instrumenter:$version"
}
45 changes: 45 additions & 0 deletions src/main/kotlin/us/ihmc/ci/IHMCCICategoriesExtension.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package us.ihmc.ci

import org.gradle.api.Project

val ALLOCATION_AGENT_KEY = "allocationAgent"

class IHMCCICategory(val name: String)
{
var forkEvery = 0 // no limit
var maxParallelForks = 1 // careful, cost of spawning JVMs is high
var junit5ParallelEnabled = false // doesn't work right now with Gradle's test runner. See: https://github.com/gradle/gradle/issues/6453
var junit5ParallelStrategy = "fixed"
var junit5ParallelFixedParallelism = 1
val excludeTags = hashSetOf<String>()
val includeTags = hashSetOf<String>()
val jvmProperties = hashMapOf<String, String>()
val jvmArguments = hashSetOf<String>()
var minHeapSizeGB = 1
var maxHeapSizeGB = 4
var enableAssertions = true
var defaultTimeout = 1200 // 20 minutes
var testTaskTimeout = 1800 // 30 minutes
var doFirst: () -> Unit = {} // run user code when this category is selected
}

open class IHMCCICategoriesExtension(private val project: Project)
{
val categories = hashMapOf<String, IHMCCICategory>()

fun configure(name: String, configuration: IHMCCICategory.() -> Unit)
{
configuration.invoke(configure(name))
}

fun configure(name: String): IHMCCICategory
{
val category = categories.getOrPut(name, { IHMCCICategory(name) })
if (name != "all" && name != "fast") // all require no includes or excludes, fast will be configured later
{
category.includeTags += name // by default, include tags of the category name
}

return category
}
}
Loading

0 comments on commit 00efc31

Please sign in to comment.