@@ -11,22 +11,44 @@ repositories {
1111 mavenCentral()
1212}
1313
14+ // Configure integration test source set
15+ sourceSets {
16+ create(" integrationTest" ) {
17+ kotlin.srcDir(" src/integrationTest/kotlin" )
18+ resources.srcDir(" src/integrationTest/resources" )
19+ compileClasspath + = sourceSets.main.get().output + sourceSets.test.get().output
20+ runtimeClasspath + = sourceSets.main.get().output + sourceSets.test.get().output
21+ }
22+ }
23+
24+ val integrationTestImplementation by configurations.getting {
25+ extendsFrom(configurations.testImplementation.get())
26+ }
27+
28+ val integrationTestRuntimeOnly by configurations.getting {
29+ extendsFrom(configurations.testRuntimeOnly.get())
30+ }
31+
1432dependencies {
1533 implementation(project(" :mpp-core" ))
1634
1735 // Serialization for test case format
1836 implementation(" org.jetbrains.kotlinx:kotlinx-serialization-json:1.8.0" )
19-
37+
2038 // Coroutines
2139 implementation(" org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.0" )
22-
40+
2341 // Logging
2442 implementation(" io.github.oshai:kotlin-logging-jvm:7.0.0" )
2543 implementation(" ch.qos.logback:logback-classic:1.5.6" )
26-
44+
2745 // Testing
2846 testImplementation(kotlin(" test" ))
2947 testImplementation(" org.jetbrains.kotlinx:kotlinx-coroutines-test:1.8.0" )
48+
49+ // Integration test dependencies
50+ integrationTestImplementation(kotlin(" test" ))
51+ integrationTestImplementation(" org.jetbrains.kotlinx:kotlinx-coroutines-test:1.8.0" )
3052}
3153
3254kotlin {
@@ -37,13 +59,36 @@ tasks.test {
3759 useJUnitPlatform()
3860}
3961
62+ // Integration test task
63+ tasks.register<Test >(" integrationTest" ) {
64+ group = " verification"
65+ description = " Run NanoDSL integration tests that call LLM and verify DSL compilation"
66+ testClassesDirs = sourceSets[" integrationTest" ].output.classesDirs
67+ classpath = sourceSets[" integrationTest" ].runtimeClasspath
68+ useJUnitPlatform()
69+
70+ // Pass environment variables for LLM configuration
71+ environment(" OPENAI_API_KEY" , System .getenv(" OPENAI_API_KEY" ) ? : " " )
72+ environment(" ANTHROPIC_API_KEY" , System .getenv(" ANTHROPIC_API_KEY" ) ? : " " )
73+ environment(" DEEPSEEK_API_KEY" , System .getenv(" DEEPSEEK_API_KEY" ) ? : " " )
74+
75+ // Integration tests may take longer
76+ systemProperty(" junit.jupiter.execution.timeout.default" , " 5m" )
77+
78+ // Show output for debugging
79+ testLogging {
80+ events(" passed" , " skipped" , " failed" )
81+ showStandardStreams = true
82+ }
83+ }
84+
4085// Custom task to run DSL evaluation tests
4186tasks.register<JavaExec >(" runDslEval" ) {
4287 group = " verification"
4388 description = " Run NanoDSL AI evaluation tests"
4489 mainClass.set(" cc.unitmesh.xuiper.eval.DslEvalRunnerKt" )
4590 classpath = sourceSets[" main" ].runtimeClasspath
46-
91+
4792 // Pass environment variables for LLM configuration
4893 environment(" OPENAI_API_KEY" , System .getenv(" OPENAI_API_KEY" ) ? : " " )
4994 environment(" ANTHROPIC_API_KEY" , System .getenv(" ANTHROPIC_API_KEY" ) ? : " " )
0 commit comments