Implement automatic Test Visibility instrumentation for .NET projects#400
Conversation
drodriguezhdez
left a comment
There was a problem hiding this comment.
I haven't investigated if the actual commands we're using in the configurator are the correct ones, but code wise I've dropped a couple of minor comments.
Apart from that, LGTM.
| String tracerVarOutput = workspacePath.act(new ShellCommandCallable(Collections.emptyMap(), SHOW_TRACER_VARS_TIMEOUT_MILLIS, workspacePath.getRemote() + File.separator + "dd-trace", "ci", "configure", "jenkins")); | ||
|
|
||
| Map<String, String> variables = new HashMap<>(); | ||
| for (String line : tracerVarOutput.split("\n")) { |
There was a problem hiding this comment.
Can tracerVarOutput be null?
There was a problem hiding this comment.
That'd be an exceptional situation, so a NullPointerException would be appropriate (the job itself won't fail anyway, it's just that we'll see the error in the logs)
| continue; | ||
| } | ||
| String[] tokens = line.split("="); | ||
| variables.put(tokens[0], tokens.length == 2 ? tokens[1] : ""); |
There was a problem hiding this comment.
What happens if the variables.get(key) returns empty string. Is this expected from the DotNet configuration perspective?
There was a problem hiding this comment.
Yes, some of the variables can (maybe even should) have an empty value, checked this with an actual .NET project
Requirements for Contributing to this repository
What does this PR do?
Implements automatic APM tracer injection and Test Visibility configuration for .NET projects.
Description of the Change
Alternate Designs
Possible Drawbacks
Verification Process
Additional Notes
Release Notes
Review checklist (to be filled by reviewers)
changelog/label attached. If applicable it should have thebackward-incompatiblelabel attached.do-not-merge/label attached.kind/andseverity/labels attached at least.