Skip to content

Commit 6067ac3

Browse files
Fix module name calculation for test executions whose working dir is outside of project repo (#6235)
1 parent 9a567fb commit 6067ac3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/CiVisibilitySystem.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,9 @@ private static TestEventsHandler.Factory testEventsHandlerFactory(
227227
CIInfo ciInfo = ciProviderInfo.buildCIInfo();
228228
String repoRoot = ciInfo.getCiWorkspace();
229229
String moduleName =
230-
(repoRoot != null) ? Paths.get(repoRoot).relativize(path).toString() : path.toString();
230+
repoRoot != null && path.startsWith(repoRoot)
231+
? Paths.get(repoRoot).relativize(path).toString()
232+
: config.getServiceName();
231233

232234
DDTestFrameworkSession testSession =
233235
sessionFactory.startSession(moduleName, path, component, null);

0 commit comments

Comments
 (0)