Skip to content

Commit

Permalink
Merge pull request #726 from kasunbg/testgrid-yaml-sample-changes
Browse files Browse the repository at this point in the history
Conform sample testgrid.yaml files to new scenarioConfig.
  • Loading branch information
kasunbg committed May 4, 2018
2 parents 3b63b2b + ab791e7 commit 784969b
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
*/
public class DeploymentUtil {

private static final Logger logger = LoggerFactory.getLogger(Deployment.class);
private static final Logger logger = LoggerFactory.getLogger(DeploymentUtil.class);

/**
* Reads the deployment.json file and constructs the deployment object.
Expand All @@ -54,6 +54,12 @@ public static DeploymentCreationResult getDeploymentCreationResult(String worksp
ObjectMapper mapper = new ObjectMapper();
File file = new File(Paths.get(workspace, DeployerConstants.DEPLOYMENT_FILE).toString());
try {
if (!file.exists()) {
logger.warn("The deployment.json file was not found at: " + file.getPath() + ". This is where the "
+ "deployment creation outputs are stored. Continuing without the deployment outputs.");
return deploymentCreationResult;
}

List<Host> hostList = mapper.readValue(file, DeploymentCreationResult.class).getHosts();
/* JMeter test files has the values for the host and ports as two properties. In order to replace
* the values, the serverHost and serverPort has to be set as two different hosts.
Expand All @@ -75,7 +81,7 @@ public static DeploymentCreationResult getDeploymentCreationResult(String worksp
} catch (IOException e) {
logger.error(e.getMessage());
throw new TestGridDeployerException(StringUtil.concatStrings(
"Error occurred while reading ", file.getAbsolutePath(), e));
"Error occurred while reading ", file.getAbsolutePath()), e);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="3.2" jmeter="3.2 r1790748">
<jmeterTestPlan version="1.2" properties="3.2" jmeter="3.3 r1808647">
<hashTree>
<TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Test IS 5.4.0 Server" enabled="true">
<stringProp name="TestPlan.comments"></stringProp>
Expand Down Expand Up @@ -51,15 +51,51 @@
<hashTree>
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Check whether IS Page is loaded" enabled="true">
<collectionProp name="Asserion.test_strings">
<stringProp name="69942279">IS540</stringProp>
<stringProp name="784638524">WSO2 Carbon Server1</stringProp>
</collectionProp>
<stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
<stringProp name="Assertion.test_field">Assertion.response_headers</stringProp>
<boolProp name="Assertion.assume_success">false</boolProp>
<intProp name="Assertion.test_type">2</intProp>
<stringProp name="Assertion.scope">all</stringProp>
</ResponseAssertion>
<hashTree/>
</hashTree>
<ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true">
<boolProp name="ResultCollector.error_logging">false</boolProp>
<objProp>
<name>saveConfig</name>
<value class="SampleSaveConfiguration">
<time>true</time>
<latency>true</latency>
<timestamp>true</timestamp>
<success>true</success>
<label>true</label>
<code>true</code>
<message>true</message>
<threadName>true</threadName>
<dataType>true</dataType>
<encoding>false</encoding>
<assertions>true</assertions>
<subresults>true</subresults>
<responseData>true</responseData>
<samplerData>false</samplerData>
<xml>true</xml>
<fieldNames>true</fieldNames>
<responseHeaders>false</responseHeaders>
<requestHeaders>false</requestHeaders>
<responseDataOnError>false</responseDataOnError>
<saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage>
<assertionsResultsToSave>0</assertionsResultsToSave>
<bytes>true</bytes>
<sentBytes>true</sentBytes>
<threadCounts>true</threadCounts>
<idleTime>true</idleTime>
<connectTime>true</connectTime>
</value>
</objProp>
<stringProp name="filename">jmeter-results.jtl</stringProp>
</ResultCollector>
<hashTree/>
</hashTree>
</hashTree>
<WorkBench guiclass="WorkBenchGui" testclass="WorkBench" testname="WorkBench" enabled="true">
Expand Down
4 changes: 3 additions & 1 deletion test-scripts/local-is-deployment/testgrid.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ infrastructureConfig:
phase: DESTROY
scenarioConfig:
scenarios:
- "solution01"
- name: 'Test scenario 01'
description: 'Test scenario 01'
dir: solution01
deploymentConfig:
deploymentPatterns:
- name: 01-local-is-deployment
Expand Down
6 changes: 3 additions & 3 deletions test-scripts/tomcat-deployment/testgrid.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ infrastructureConfig:
# type : <string>
scenarioConfig:
scenarios:
- "scenario01"
- name: 'Test scenario 01'
description: 'Test scenario 01'
dir: scenario01
deploymentConfig:
deploymentPatterns:
- name: 01-testgrid-tomcat-deployment
description: Deploys a Tomcat in AWS
dir: .
# inputsForInfrastructurefile:
# - requiredVMCount: 2
scripts:
- type: SHELL
description: Do a IS two node deployment.
Expand Down

0 comments on commit 784969b

Please sign in to comment.