Skip to content
Permalink
Browse files

[JENKINS-46064] Add json roundtrip tests for the new when conditions

  • Loading branch information...
rsandell committed Aug 17, 2017
1 parent 86d1115 commit f1614bcaff62634c4544031881b1c473ba5c0f38
@@ -162,7 +162,9 @@ public void setUp() throws Exception {
"usernamePassword",
"environmentCrossReferences",
"nestedParallelStages",
"stagePost"
"stagePost",
"when/changelog/changelog",
"when/changelog/changeset"
);

public static Iterable<Object[]> configsWithErrors() {
@@ -57,7 +57,7 @@
@BeforeClass
public static void setUpAgentAndCreds() throws Exception {
s = j.createOnlineSlave();
s.setLabelString("some-label docker");
s.setLabelString("some-label docker here");
s.getNodeProperties().add(new EnvironmentVariablesNodeProperty(new EnvironmentVariablesNodeProperty.Entry("ONAGENT", "true")));

CredentialsStore store = CredentialsProvider.lookupStores(j.jenkins).iterator().next();
@@ -0,0 +1,50 @@
{"pipeline": {
"stages": [
{
"name": "One",
"branches": [ {
"name": "default",
"steps": [ {
"name": "echo",
"arguments": [ {
"key": "message",
"value": {
"isLiteral": true,
"value": "Hello"
}
}]
}]
}]
},
{
"name": "Two",
"branches": [ {
"name": "default",
"steps": [ {
"name": "script",
"arguments": [ {
"key": "scriptBlock",
"value": {
"isLiteral": true,
"value": "echo \"Dull World\""
}
}]
}]
}],
"when": {"conditions": [ {
"name": "changelog",
"arguments": {
"isLiteral": true,
"value": ".*^\\[DEPENDENCY\\] .+$"
}
}]}
}
],
"agent": {
"type": "label",
"argument": {
"isLiteral": true,
"value": "here"
}
}
}}
@@ -0,0 +1,50 @@
{"pipeline": {
"stages": [
{
"name": "One",
"branches": [ {
"name": "default",
"steps": [ {
"name": "echo",
"arguments": [ {
"key": "message",
"value": {
"isLiteral": true,
"value": "Hello"
}
}]
}]
}]
},
{
"name": "Two",
"branches": [ {
"name": "default",
"steps": [ {
"name": "script",
"arguments": [ {
"key": "scriptBlock",
"value": {
"isLiteral": true,
"value": "echo \"JS World\""
}
}]
}]
}],
"when": {"conditions": [ {
"name": "changeset",
"arguments": {
"isLiteral": true,
"value": "**/*.js"
}
}]}
}
],
"agent": {
"type": "label",
"argument": {
"isLiteral": true,
"value": "here"
}
}
}}

0 comments on commit f1614bc

Please sign in to comment.
You can’t perform that action at this time.