From b126e1ac349132ae5998c8d0e513a5c17321ca3d Mon Sep 17 00:00:00 2001 From: Kasun Gajasinghe Date: Tue, 1 May 2018 14:53:14 +0530 Subject: [PATCH 1/3] Conform sample testgrid.yaml files to new scenarioConfig. --- test-scripts/local-is-deployment/testgrid.yaml | 4 +++- test-scripts/tomcat-deployment/testgrid.yaml | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/test-scripts/local-is-deployment/testgrid.yaml b/test-scripts/local-is-deployment/testgrid.yaml index b1683611b..e97a4a3e6 100644 --- a/test-scripts/local-is-deployment/testgrid.yaml +++ b/test-scripts/local-is-deployment/testgrid.yaml @@ -40,7 +40,9 @@ infrastructureConfig: phase: DESTROY scenarioConfig: scenarios: - - "solution01" + - name: 'Test scenario 01' + description: 'Test scenario 01' + dir: scenario01 deploymentConfig: deploymentPatterns: - name: 01-local-is-deployment diff --git a/test-scripts/tomcat-deployment/testgrid.yaml b/test-scripts/tomcat-deployment/testgrid.yaml index 2caa7d51e..efe772cc0 100644 --- a/test-scripts/tomcat-deployment/testgrid.yaml +++ b/test-scripts/tomcat-deployment/testgrid.yaml @@ -45,14 +45,14 @@ infrastructureConfig: # type : 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. From b87aec2b9b6475511555b106ad4e62b00fe7253b Mon Sep 17 00:00:00 2001 From: Kasun Gajasinghe Date: Tue, 1 May 2018 18:54:46 +0530 Subject: [PATCH 2/3] Set correct logger class name Properly throw the caused-by exception. --- .../java/org/wso2/testgrid/deployment/DeploymentUtil.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployment/src/main/java/org/wso2/testgrid/deployment/DeploymentUtil.java b/deployment/src/main/java/org/wso2/testgrid/deployment/DeploymentUtil.java index 6b1623f74..128d6151b 100755 --- a/deployment/src/main/java/org/wso2/testgrid/deployment/DeploymentUtil.java +++ b/deployment/src/main/java/org/wso2/testgrid/deployment/DeploymentUtil.java @@ -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. @@ -75,7 +75,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); } } } From ab791e75864d5cb55c3006625a914b973c46617e Mon Sep 17 00:00:00 2001 From: Kasun Gajasinghe Date: Fri, 4 May 2018 14:08:44 +0530 Subject: [PATCH 3/3] Fixes local-is-deployment test-script issues --- .../testgrid/deployment/DeploymentUtil.java | 6 +++ .../solution01/jmeter/01-TestIS540.jmx | 42 +++++++++++++++++-- .../local-is-deployment/testgrid.yaml | 2 +- 3 files changed, 46 insertions(+), 4 deletions(-) diff --git a/deployment/src/main/java/org/wso2/testgrid/deployment/DeploymentUtil.java b/deployment/src/main/java/org/wso2/testgrid/deployment/DeploymentUtil.java index 128d6151b..beee5a1c0 100755 --- a/deployment/src/main/java/org/wso2/testgrid/deployment/DeploymentUtil.java +++ b/deployment/src/main/java/org/wso2/testgrid/deployment/DeploymentUtil.java @@ -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 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. diff --git a/test-scripts/local-is-deployment/Solutions/solution01/jmeter/01-TestIS540.jmx b/test-scripts/local-is-deployment/Solutions/solution01/jmeter/01-TestIS540.jmx index 335181dbe..9e1a3597e 100644 --- a/test-scripts/local-is-deployment/Solutions/solution01/jmeter/01-TestIS540.jmx +++ b/test-scripts/local-is-deployment/Solutions/solution01/jmeter/01-TestIS540.jmx @@ -1,5 +1,5 @@ - + @@ -51,15 +51,51 @@ - IS540 + WSO2 Carbon Server1 - Assertion.response_data + Assertion.response_headers false 2 all + + false + + saveConfig + + + true + true + true + + true + true + true + true + false + true + true + true + false + true + true + false + false + false + true + 0 + true + true + true + true + true + + + jmeter-results.jtl + + diff --git a/test-scripts/local-is-deployment/testgrid.yaml b/test-scripts/local-is-deployment/testgrid.yaml index e97a4a3e6..65be7109b 100644 --- a/test-scripts/local-is-deployment/testgrid.yaml +++ b/test-scripts/local-is-deployment/testgrid.yaml @@ -42,7 +42,7 @@ scenarioConfig: scenarios: - name: 'Test scenario 01' description: 'Test scenario 01' - dir: scenario01 + dir: solution01 deploymentConfig: deploymentPatterns: - name: 01-local-is-deployment