[fix](regression)when using regression-conf-custom.groovy, properties in regression-conf.groovy are missing #14458

This commit is contained in:
minghong
2022-11-22 08:44:50 +08:00
committed by GitHub
parent ca486cdfbc
commit 034aa20b0a

View File

@ -123,16 +123,12 @@ class Config {
def systemProperties = Maps.newLinkedHashMap(System.getProperties())
configSlurper.setBinding(systemProperties)
ConfigObject configObj = configSlurper.parse(new File(confFilePath).toURI().toURL())
config = Config.fromConfigObject(configObj)
}
String customConfFilePath = confFile.getParentFile().getPath() + "/regression-conf-custom.groovy"
File custFile = new File(customConfFilePath)
if (custFile.exists() && custFile.isFile()) {
log.info("Load custom config file ${customConfFilePath}".toString())
def configSlurper = new ConfigSlurper()
def systemProperties = Maps.newLinkedHashMap(System.getProperties())
configSlurper.setBinding(systemProperties)
ConfigObject configObj = configSlurper.parse(new File(customConfFilePath).toURI().toURL())
String customConfFilePath = confFile.getParentFile().getPath() + "/regression-conf-custom.groovy"
File custFile = new File(customConfFilePath)
if (custFile.exists() && custFile.isFile()) {
ConfigObject custConfigObj = configSlurper.parse(new File(customConfFilePath).toURI().toURL())
configObj.merge(custConfigObj)
}
config = Config.fromConfigObject(configObj)
}
fillDefaultConfig(config)
@ -274,7 +270,8 @@ class Config {
}
if (config.jdbcUrl == null) {
config.jdbcUrl = "jdbc:mysql://127.0.0.1:9030"
//jdbcUrl needs parameter here. Refer to function: buildUrl(String dbName)
config.jdbcUrl = "jdbc:mysql://127.0.0.1:9030/?useLocalSessionState=true"
log.info("Set jdbcUrl to '${config.jdbcUrl}' because not specify.".toString())
}