Skip to content

Integration tests should take the env variable for WDT version to download #1242

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public class BaseTest {
public static boolean SMOKETEST;
public static boolean JENKINS;
public static boolean SHARED_CLUSTER;
public static String WDT_VERSION;
public static boolean INGRESSPERDOMAIN = true;
protected static String appLocationInPod = "/u01/oracle/apps";
private static String resultRoot = "";
Expand Down Expand Up @@ -133,6 +134,11 @@ public static void initialize(String appPropsFile) throws Exception {
System.getenv("DOMAIN_API_VERSION") != null
? System.getenv("DOMAIN_API_VERSION")
: appProps.getProperty("DOMAIN_API_VERSION");
WDT_VERSION =
System.getenv("WDT_VERSION") != null
? System.getenv("WDT_VERSION")
: appProps.getProperty("WDT_VERSION");

maxIterationsPod =
new Integer(appProps.getProperty("maxIterationsPod", "" + maxIterationsPod)).intValue();
waitTimePod = new Integer(appProps.getProperty("waitTimePod", "" + waitTimePod)).intValue();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1618,7 +1618,6 @@ protected void initialize(Map<String, Object> inputDomainMap) throws Exception {
domainMap.put("domainHomeImageBase",
BaseTest.getWeblogicImageName() + ":" + BaseTest.getWeblogicImageTag());
}

// remove null values if any attributes
domainMap.values().removeIf(Objects::isNull);

Expand Down Expand Up @@ -1818,7 +1817,9 @@ private void copyCreateDomainPy() throws IOException {
*/
private String prepareCmdToCallCreateDomainScript(String outputDir) {

StringBuffer createDomainScriptCmd = new StringBuffer(BaseTest.getResultDir());
StringBuffer createDomainScriptCmd = new StringBuffer("export WDT_VERSION=");
createDomainScriptCmd.append(BaseTest.WDT_VERSION).append(" && ")
.append(BaseTest.getResultDir());
// call different create-domain.sh based on the domain type
if (domainMap.containsKey("domainHomeImageBase")) {
createDomainScriptCmd
Expand Down
1 change: 1 addition & 0 deletions integration-tests/src/test/resources/OperatorIT.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ weblogicImageDevTag = 12.2.1.3-dev
weblogicImageName = container-registry.oracle.com/middleware/weblogic
OCR_SERVER=container-registry.oracle.com
DOMAIN_API_VERSION = weblogic.oracle/v5
WDT_VERSION=1.2.0
5 changes: 4 additions & 1 deletion kubernetes/samples/scripts/common/utility.sh
Original file line number Diff line number Diff line change
Expand Up @@ -319,14 +319,16 @@ function createFiles {
weblogicCredentialsSecretName="${domainUID}-weblogic-credentials"
fi

wdtVersion="${WDT_VERSION}"

if [ "${domainHomeInImage}" == "true" ]; then
domainPropertiesOutput="${domainOutputDir}/domain.properties"
domainHome="/u01/oracle/user_projects/domains/${domainName}"

if [ -z $domainHomeImageBuildPath ]; then
domainHomeImageBuildPath="./docker-images/OracleWebLogic/samples/12213-domain-home-in-image"
fi

# Generate the properties file that will be used when creating the weblogic domain
echo Generating ${domainPropertiesOutput}

Expand Down Expand Up @@ -412,6 +414,7 @@ function createFiles {
sed -i -e "s:%ISTIO_PREFIX%:${istioPrefix}:g" ${createJobOutput}
sed -i -e "s:%ISTIO_ENABLED%:${istioEnabled}:g" ${createJobOutput}
sed -i -e "s:%ISTIO_READINESS_PORT%:${istioReadinessPort}:g" ${createJobOutput}
sed -i -e "s:%WDT_VERSION%:${wdtVersion}:g" ${createJobOutput}

# Generate the yaml to create the kubernetes job that will delete the weblogic domain_home folder
echo Generating ${deleteJobOutput}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ spec:
value: "%ISTIO_ENABLED%"
- name: ISTIO_READINESS_PORT
value: "%ISTIO_READINESS_PORT%"
- name: WDT_VERSION
value: %WDT_VERSION%
volumes:
- name: create-weblogic-sample-domain-job-cm-volume
configMap:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@
# $WDT_MODEL_FILE and $WDT_MODEL_VARS. Also the location
# of WDT log files.
# default: /shared/wdt
# WDT_VERSION WDT version to download.
# default: 1.2.0
#
# DOMAIN_HOME_DIR Target location for generated domain.
#
Expand All @@ -73,9 +75,10 @@ WDT_MODEL_FILE=${WDT_MODEL_FILE:-"$SCRIPTPATH/wdt_model.yaml"}
WDT_VAR_FILE=${WDT_VAR_FILE:-"$SCRIPTPATH/create-domain-inputs.yaml"}

WDT_DIR=${WDT_DIR:-/shared/wdt}
WDT_VERSION=${WDT_VERSION:-1.2.0}

WDT_INSTALL_ZIP_FILE="${WDT_INSTALL_ZIP_FILE:-weblogic-deploy.zip}"
WDT_INSTALL_ZIP_URL=${WDT_INSTALL_ZIP_URL:-"https://github.com/oracle/weblogic-deploy-tooling/releases/download/weblogic-deploy-tooling-1.2.0/$WDT_INSTALL_ZIP_FILE"}
WDT_INSTALL_ZIP_URL=${WDT_INSTALL_ZIP_URL:-"https://github.com/oracle/weblogic-deploy-tooling/releases/download/weblogic-deploy-tooling-$WDT_VERSION/$WDT_INSTALL_ZIP_FILE"}

# using "-" instead of ":-" in case proxy vars are explicitly set to "".
https_proxy=${https_proxy-""}
Expand Down