Skip to content

Commit 5446950

Browse files
authored
Merge pull request #482 from kasunbg/change-testplan-dir
Rename the productName in local-is-deployment test scripts
2 parents 08a15c1 + 9f26f87 commit 5446950

File tree

4 files changed

+11
-20
lines changed

4 files changed

+11
-20
lines changed

common/src/main/java/org/wso2/testgrid/common/TestGridConstants.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public class TestGridConstants {
2929

3030
// Logging constants
3131
public static final String TEST_LOG_FILE_NAME = "test-run.log";
32+
public static final String PRODUCT_TEST_PLANS_DIR = "test-plans";
3233
public static final String TESTGRID_HOME_ENV = "TESTGRID_HOME";
3334
public static final String TESTGRID_HOME_SYSTEM_PROPERTY = "testgrid.home";
3435
public static final Path DEFAULT_TESTGRID_HOME = Paths.get(System.getProperty("user.home"), ".testgrid");

core/src/main/java/org/wso2/testgrid/core/command/GenerateTestPlanCommand.java

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@
5353
import java.util.Map;
5454
import java.util.Set;
5555

56+
import static org.wso2.testgrid.common.TestGridConstants.PRODUCT_TEST_PLANS_DIR;
57+
5658
/**
5759
* Responsible for generating the infrastructure plan and persisting them in the file system.
5860
*
@@ -213,33 +215,21 @@ private List<Map<String, Object>> toConfigAwareInfrastructureCombination(Set<Inf
213215
*/
214216
private String createTestPlanGenDirectory(Product product) throws CommandExecutionException {
215217
try {
216-
String directoryName = product.getId();
218+
String directoryName = product.getName();
217219
String testGridHome = TestGridUtil.getTestGridHomePath();
218-
Path directory = Paths.get(testGridHome, directoryName).toAbsolutePath();
220+
Path directory = Paths.get(testGridHome, directoryName, PRODUCT_TEST_PLANS_DIR).toAbsolutePath();
219221

220222
// if the directory exists, remove it
221223
removeDirectories(directory);
222224

223-
logger.info(StringUtil.concatStrings("Creating test directory : ", directory.toString()));
224-
Path createdDirectory = createDirectories(directory);
225-
logger.info(StringUtil.concatStrings("Directory created : ", createdDirectory.toAbsolutePath().toString()));
226-
return createdDirectory.toAbsolutePath().toString();
225+
Path createdDirectory = Files.createDirectories(directory).toAbsolutePath();
226+
logger.info(StringUtil.concatStrings("Test plans dir: ", createdDirectory.toString()));
227+
return createdDirectory.toString();
227228
} catch (IOException e) {
228229
throw new CommandExecutionException("Error in creating infra generation directory", e);
229230
}
230231
}
231232

232-
/**
233-
* Creates the given directory structure.
234-
*
235-
* @param directory directory structure to create
236-
* @return created directory structure
237-
* @throws IOException thrown when error on creating directory structure
238-
*/
239-
private Path createDirectories(Path directory) throws IOException {
240-
return Files.createDirectories(directory.toAbsolutePath());
241-
}
242-
243233
/**
244234
* Removes the given directory structure if exists.
245235
*

core/src/main/java/org/wso2/testgrid/core/command/RunTestPlanCommand.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,9 @@ private Optional<String> getTestPlanGenFilePath(Product product) throws IOExcept
218218
* @return path for the generated test plan YAML files directory
219219
*/
220220
private Path getTestPlanGenLocation(Product product) throws IOException {
221-
String directoryName = product.getId();
221+
String directoryName = product.getName();
222222
String testGridHome = TestGridUtil.getTestGridHomePath();
223-
return Paths.get(testGridHome, directoryName).toAbsolutePath();
223+
return Paths.get(testGridHome, directoryName, TestGridConstants.PRODUCT_TEST_PLANS_DIR).toAbsolutePath();
224224
}
225225

226226
/**

test-scripts/local-is-deployment/test-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
################################################################################
1616

1717
# TestGrid Test Configuration Parameters
18-
productName: "wso2is-5.4.0-LTS"
18+
productName: "wso2is-local-deployment"
1919
deploymentPatterns:
2020
- "pattern-2"
2121
infraParams:

0 commit comments

Comments
 (0)