|
| 1 | +plugins { |
| 2 | + id 'java' |
| 3 | +} |
| 4 | + |
| 5 | +java { |
| 6 | + toolchain { |
| 7 | + languageVersion = JavaLanguageVersion.of(17) |
| 8 | + vendor = JvmVendorSpec.ADOPTIUM |
| 9 | + } |
| 10 | +} |
| 11 | + |
| 12 | +repositories { |
| 13 | + mavenCentral() |
| 14 | +} |
| 15 | + |
| 16 | +def langchainVersion = '1.8.0' |
| 17 | + |
| 18 | +ext { |
| 19 | + otelVersion = rootProject.ext.otelVersion |
| 20 | + junitVersion = rootProject.ext.junitVersion |
| 21 | + slf4jVersion = rootProject.ext.slf4jVersion |
| 22 | +} |
| 23 | + |
| 24 | +dependencies { |
| 25 | + testImplementation project(":braintrust-sdk") |
| 26 | + testImplementation project(":braintrust-sdk:instrumentation:langchain_1_8_0") |
| 27 | + testImplementation project(":braintrust-java-agent:instrumenter") |
| 28 | + testImplementation(testFixtures(project(":test-harness"))) |
| 29 | + |
| 30 | + testImplementation "io.opentelemetry:opentelemetry-api:${otelVersion}" |
| 31 | + testImplementation "io.opentelemetry:opentelemetry-sdk:${otelVersion}" |
| 32 | + testImplementation "io.opentelemetry:opentelemetry-sdk-trace:${otelVersion}" |
| 33 | + testImplementation "io.opentelemetry:opentelemetry-sdk-logs:${otelVersion}" |
| 34 | + testImplementation "io.opentelemetry:opentelemetry-sdk-metrics:${otelVersion}" |
| 35 | + |
| 36 | + testImplementation "dev.langchain4j:langchain4j:${langchainVersion}" |
| 37 | + testImplementation "dev.langchain4j:langchain4j-http-client:${langchainVersion}" |
| 38 | + testImplementation "dev.langchain4j:langchain4j-open-ai:${langchainVersion}" |
| 39 | + |
| 40 | + testImplementation 'net.bytebuddy:byte-buddy-agent:1.17.5' |
| 41 | + |
| 42 | + testImplementation "org.junit.jupiter:junit-jupiter:${junitVersion}" |
| 43 | + testRuntimeOnly 'org.junit.platform:junit-platform-launcher' |
| 44 | + testRuntimeOnly "org.slf4j:slf4j-simple:${slf4jVersion}" |
| 45 | +} |
| 46 | + |
| 47 | +// Disable the default test task so perf tests don't run during ./gradlew test or check. |
| 48 | +// Run explicitly with: ./gradlew :perf-tests:perfTest |
| 49 | +test { |
| 50 | + enabled = false |
| 51 | +} |
| 52 | + |
| 53 | +task perfTest(type: Test) { |
| 54 | + useJUnitPlatform() |
| 55 | + workingDir = rootProject.projectDir |
| 56 | + |
| 57 | + // Performance tests can be slow — give them generous timeouts |
| 58 | + systemProperty 'junit.jupiter.execution.timeout.default', '120s' |
| 59 | + |
| 60 | + testLogging { |
| 61 | + events "passed", "skipped", "failed" |
| 62 | + showStandardStreams = true |
| 63 | + exceptionFormat "full" |
| 64 | + } |
| 65 | +} |
0 commit comments