Skip to content

Commit ca98ba3

Browse files
authored
Add note to copilot instructions around gradle 9 tests (open-telemetry#2256)
1 parent 901e64b commit ca98ba3

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

.github/copilot-instructions.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,33 @@ This repository provides observability instrumentation for Java applications.
2929
- Resource cleanup and lifecycle management
3030
- Comprehensive unit tests for new functionality
3131

32+
### Test suites
33+
34+
This project uses gradle 9 which requires specifying test classes and paths explicitly.
35+
36+
For example, this will NOT work because it registers a `Test` without specifying the test classes or paths:
37+
38+
```kotlin
39+
tasks.register<Test>("IntegrationTestUserCreds") {
40+
dependsOn(tasks.shadowJar)
41+
dependsOn(tasks.named("copyAgent"))
42+
...
43+
}
44+
```
45+
46+
This is fixed by specifying the test classes and classpath explicitly:
47+
48+
```kotlin
49+
tasks.register<Test>("IntegrationTestUserCreds") {
50+
testClassesDirs = sourceSets.test.get().output.classesDirs
51+
classpath = sourceSets.test.get().runtimeClasspath
52+
53+
dependsOn(tasks.shadowJar)
54+
dependsOn(tasks.named("copyAgent"))
55+
...
56+
}
57+
```
58+
3259
## Coding Agent Instructions
3360

3461
When implementing changes or new features:

0 commit comments

Comments
 (0)