-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support declarative Test Visibility configuration in pipeline scripts
- Loading branch information
1 parent
0327efa
commit fa17562
Showing
7 changed files
with
208 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
src/main/java/org/datadog/jenkins/plugins/datadog/steps/TestVisibility.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package org.datadog.jenkins.plugins.datadog.steps; | ||
|
||
import java.io.Serializable; | ||
import java.util.Collection; | ||
import java.util.Collections; | ||
import java.util.Map; | ||
import org.datadog.jenkins.plugins.datadog.tracer.TracerLanguage; | ||
import org.kohsuke.stapler.DataBoundConstructor; | ||
import org.kohsuke.stapler.DataBoundSetter; | ||
|
||
public class TestVisibility implements Serializable { | ||
private boolean enabled; | ||
private String serviceName; | ||
private Collection<TracerLanguage> languages = Collections.emptyList(); | ||
private Map<String, String> additionalVariables = Collections.emptyMap(); | ||
|
||
@DataBoundConstructor | ||
public TestVisibility() { | ||
} | ||
|
||
public boolean getEnabled() { | ||
return enabled; | ||
} | ||
|
||
@DataBoundSetter | ||
public void setEnabled(boolean enabled) { | ||
this.enabled = enabled; | ||
} | ||
|
||
public String getServiceName() { | ||
return serviceName; | ||
} | ||
|
||
@DataBoundSetter | ||
public void setServiceName(String serviceName) { | ||
this.serviceName = serviceName; | ||
} | ||
|
||
public Collection<TracerLanguage> getLanguages() { | ||
return languages; | ||
} | ||
|
||
@DataBoundSetter | ||
public void setLanguages(Collection<TracerLanguage> languages) { | ||
this.languages = languages; | ||
} | ||
|
||
public Map<String, String> getAdditionalVariables() { | ||
return additionalVariables; | ||
} | ||
|
||
@DataBoundSetter | ||
public void setAdditionalVariables(Map<String, String> additionalVariables) { | ||
this.additionalVariables = additionalVariables; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
...rces/org/datadog/jenkins/plugins/datadog/tracer/test-maven-pipeline-with-datadog-step.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
pipeline { | ||
agent { | ||
label 'built-in' | ||
} | ||
options { | ||
datadog(testVisibility: [ enabled: true, serviceName: "my-service", languages: ["JAVA"], additionalVariables: ["my-var": "value"] ]) | ||
} | ||
stages { | ||
stage('test') { | ||
steps { | ||
$PIPELINE_STEPS | ||
} | ||
} | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
src/test/resources/org/datadog/jenkins/plugins/datadog/tracer/test-maven-pipeline.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
pipeline { | ||
agent { | ||
label '$AGENT_LABEL' | ||
} | ||
stages { | ||
stage('test') { | ||
steps { | ||
$PIPELINE_STEPS | ||
} | ||
} | ||
} | ||
} |