Skip to content

Commit b40250a

Browse files
CarolynRountreerobertpatrickrakillen
authored
Wdt 663 fix alias tests for reduce time (#1210)
* add defaults and derived default flag * default value change * default value change * Update WLSDeployZipFile.java remove println * adding uses_path_tokens, where appropriate * fixing a broken unit test caused by adding uses_path_tokens to the FileStore Directory attribute * renaming the top-level system-test directory * Corrected error message key * fixing merge issues * Corrected token name * Fixed attributes with "None" values, server template date format and algorithms * Restored SecurityConfiguration PasswordDigestEnabled and ActiveType to match WLS * Fix for flattened folders without tokens in location * moving alias-test directory * Call is_set() on discover unless -remote command-line argument is present * Remove 'Alias Test' stage from Jenkinsfile Co-authored-by: Robert Patrick <robert.patrick@oracle.com> Co-authored-by: Richard Killen <richard.killen@oracle.com>
1 parent eb47637 commit b40250a

File tree

131 files changed

+804
-513
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

131 files changed

+804
-513
lines changed

Jenkinsfile

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,6 @@ pipeline {
6464
steps {
6565
sh 'mvn -B -DskipITs=false -Dmw_home=${ORACLE_HOME} -Ddb.use.container.network=true install'
6666
}
67-
post {
68-
always {
69-
junit 'system-test/integration-tests/target/failsafe-reports/*.xml'
70-
}
71-
}
7267
}
7368
stage ('Analyze') {
7469
when {
@@ -89,6 +84,7 @@ pipeline {
8984
}
9085
}
9186
}
87+
/*
9288
stage ('Alias Test') {
9389
// only run this stage when triggered by a cron timer and the commit does not have []skip-ci in the message
9490
// for example, only run integration tests during the timer triggered nightly build
@@ -130,6 +126,7 @@ pipeline {
130126
}
131127
}
132128
}
129+
*/
133130
stage ('Save Nightly Installer'){
134131
when {
135132
allOf {

alias-test/pom.xml

Lines changed: 0 additions & 105 deletions
This file was deleted.

core/src/main/python/wlsdeploy/aliases/alias_constants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
CONTAINS = 'contains'
1313
DEFAULT_NAME_VALUE = 'default_name_value'
1414
DEFAULT_VALUE = 'default_value'
15+
DERIVED_DEFAULT = 'derived_default'
1516
FLATTENED_FOLDER_DATA = 'flattened_folder_data'
1617
FOLDERS = 'folders'
1718
FOLDER_ORDER = 'folder_order'

core/src/main/python/wlsdeploy/aliases/aliases.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from wlsdeploy.aliases.alias_constants import ATTRIBUTES
1818
from wlsdeploy.aliases.alias_constants import ChildFoldersTypes
1919
from wlsdeploy.aliases.alias_constants import DEFAULT_VALUE
20+
from wlsdeploy.aliases.alias_constants import DERIVED_DEFAULT
2021
from wlsdeploy.aliases.alias_constants import FLATTENED_FOLDER_DATA
2122
from wlsdeploy.aliases.alias_constants import FOLDERS
2223
from wlsdeploy.aliases.alias_constants import GET
@@ -1297,6 +1298,26 @@ def decrypt_password(self, text):
12971298

12981299
return rtnval
12991300

1301+
def is_derived_default(self, location, model_attribute):
1302+
"""
1303+
Return whether the default is derived by WLST.
1304+
:param location: current location
1305+
:param model_attribute: model name of attribute to check
1306+
:return: True if the default is derived
1307+
"""
1308+
_method_name = "get_derived_default"
1309+
self._logger.entering(model_attribute, class_name=self._class_name, method_name=_method_name)
1310+
result = False
1311+
try:
1312+
attribute_info = self._alias_entries.get_alias_attribute_entry_by_wlst_name(location, model_attribute)
1313+
if attribute_info is not None and DERIVED_DEFAULT in attribute_info:
1314+
result = attribute_info[DERIVED_DEFAULT]
1315+
except AliasException, ae:
1316+
self._raise_exception(ae, _method_name, 'WLSDPLY-19045', model_attribute, location.get_folder_path(),
1317+
ae.getLocalizedMessage())
1318+
self._logger.exiting(class_name=self._class_name, method_name=_method_name, result=result)
1319+
return result
1320+
13001321
###########################################################################
13011322
# Convenience Methods #
13021323
###########################################################################

core/src/main/python/wlsdeploy/tool/discover/discoverer.py

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def add_to_remote_map(self, local_name, archive_name, file_type):
6868
if not os.path.isabs(local_name):
6969
local_name = os.path.join(self._model_context.get_domain_home(), local_name)
7070
# we don't know the remote machine type, so automatically turn into forward
71-
# slashes.
71+
# slashes.
7272
local_name = local_name.replace('\\', '/')
7373
remote_dict[local_name] = OrderedDict()
7474
remote_dict[local_name][REMOTE_TYPE] = file_type
@@ -129,9 +129,15 @@ def _populate_model_parameters(self, dictionary, location):
129129
wlst_value = wlst_lsa_params[wlst_lsa_param]
130130

131131
# if attribute was never set (online only), don't add to the model
132-
if not self._wlst_helper.is_set(wlst_lsa_param):
133-
_logger.finest('WLSDPLY-06157', wlst_lsa_param, str(location), class_name=_class_name,
134-
method_name=_method_name)
132+
try:
133+
134+
if self._omit_from_model(location, wlst_lsa_param):
135+
_logger.finest('WLSDPLY-06157', wlst_lsa_param, str(location), class_name=_class_name,
136+
method_name=_method_name)
137+
continue
138+
except DiscoverException, de:
139+
_logger.info("WLSDPLY-06158", wlst_lsa_param, str(location), de.getLocalizedMessage(),
140+
class_name=_class_name, method_name=_method_name)
135141
continue
136142

137143
self._add_to_dictionary(dictionary, location, wlst_lsa_param, wlst_value, wlst_path)
@@ -144,6 +150,21 @@ def _populate_model_parameters(self, dictionary, location):
144150
if success:
145151
self._add_to_dictionary(dictionary, location, get_attribute, wlst_value, wlst_path)
146152

153+
def _omit_from_model(self, location, wlst_lsa_param):
154+
"""
155+
Determine if the specified attribute should be omitted from the model.
156+
Avoid calling wlst_helper.is_set() if possible, it slows down the online discovery process.
157+
:param location: the location of the attribute to be examined
158+
:param wlst_lsa_param: the name of the attribute to be examined
159+
:return: True if attribute should be omitted, False otherwise
160+
"""
161+
# attributes with derived defaults need to call is_set(), since their value is dynamic.
162+
# don't call is_set() if the -remote command-line argument is used.
163+
if self._aliases.is_derived_default(location, wlst_lsa_param) or not self._model_context.is_remote():
164+
# wlst_helper.is_set already checks for offline / online
165+
return not self._wlst_helper.is_set(wlst_lsa_param)
166+
return False
167+
147168
def _get_attribute_value_with_get(self, wlst_get_param, wlst_path):
148169
_method_name = '_get_attribute_value_with_get'
149170
_logger.finest('WLSDPLY-06104', wlst_get_param, class_name=_class_name, method_name=_method_name)
@@ -153,7 +174,7 @@ def _get_attribute_value_with_get(self, wlst_get_param, wlst_path):
153174
wlst_value = self._wlst_helper.get(wlst_get_param)
154175
success = True
155176
except DiscoverException, pe:
156-
_logger.warning('WLSDPLY-06127', wlst_get_param, wlst_path, pe.getLocalizedMessage(),
177+
_logger.info('WLSDPLY-06127', wlst_get_param, wlst_path, pe.getLocalizedMessage(),
157178
class_name=_class_name, method_name=_method_name)
158179
return success, wlst_value
159180

core/src/main/python/wlsdeploy/tool/util/default_authenticator_helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ def _get_required_attribute(self, dictionary, name, mapping_type, mapping_name):
204204
result = dictionary_utils.get_element(dictionary, name)
205205

206206
if result is None:
207-
pwe = exception_helper.create_exception(self._exception_type, '-01791', name, mapping_type,
207+
pwe = exception_helper.create_exception(self._exception_type, 'WLSDPLY-01791', name, mapping_type,
208208
mapping_name)
209209
self._logger.throwing(class_name=self._class_name, method_name=_method_name, error=pwe)
210210
raise pwe

core/src/main/resources/oracle/weblogic/deploy/aliases/category_modules/AppDeployment.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
"Notes": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "Notes", "wlst_path": "WP001", "default_value": null, "wlst_type": "string" } ],
6161
"OnDemandContextPaths": [ {"version": "[10,)", "wlst_mode": "online", "wlst_name": "OnDemandContextPaths", "wlst_path": "WP001", "default_value": "[]", "wlst_type": "jarray", "get_method": "GET", "access": "RO" } ],
6262
"OnDemandDisplayRefresh": [ {"version": "[10,)", "wlst_mode": "online", "wlst_name": "OnDemandDisplayRefresh", "wlst_path": "WP001", "default_value": "false", "wlst_type": "boolean", "get_method": "GET", "access": "RO" } ],
63-
"ParallelDeployModules": [ {"version": "[12.2.1,)", "wlst_mode": "both", "wlst_name": "ParallelDeployModules", "wlst_path": "WP001", "default_value": "false", "wlst_type": "boolean" } ],
63+
"ParallelDeployModules": [ {"version": "[12.2.1,)", "wlst_mode": "both", "wlst_name": "ParallelDeployModules", "wlst_path": "WP001", "default_value": "false", "derived_default": "true", "wlst_type": "boolean" } ],
6464
"PartitionName": [ {"version": "[12.2.1,)", "wlst_mode": "online", "wlst_name": "PartitionName", "wlst_path": "WP001", "default_value": null, "wlst_type": "string" , "get_method": "GET", "access": "RO" } ],
6565
"PlanDir": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "PlanDir", "wlst_path": "WP001", "default_value": null, "wlst_type": "string", "access": "${:ROD}", "uses_path_tokens": "true" } ],
6666
"PlanPath": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "PlanPath", "wlst_path": "WP001", "default_value": null, "wlst_type": "string", "access": "${:ROD}", "uses_path_tokens": "true" } ],

core/src/main/resources/oracle/weblogic/deploy/aliases/category_modules/CdiContainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"attributes": {
1010
"ImplicitBeanDiscoveryEnabled": [ {"version": "[12.2.1,)", "wlst_mode": "both", "wlst_name": "ImplicitBeanDiscoveryEnabled", "wlst_path": "WP001", "default_value": "true", "wlst_type": "boolean" } ],
1111
"Notes": [ {"version": "[12.2.1,)", "wlst_mode": "both", "wlst_name": "Notes", "wlst_path": "WP001", "default_value": null, "wlst_type": "string" } ],
12-
"Policy": [ {"version": "[12.2.1.1,)", "wlst_mode": "both", "wlst_name": "Policy", "wlst_path": "WP001", "default_value": null, "wlst_type": "string" } ]
12+
"Policy": [ {"version": "[12.2.1.1,)", "wlst_mode": "both", "wlst_name": "Policy", "wlst_path": "WP001", "default_value": "${__NULL__:Enabled}", "wlst_type": "string" } ]
1313
},
1414
"wlst_attributes_path": "WP001",
1515
"wlst_paths": {

core/src/main/resources/oracle/weblogic/deploy/aliases/category_modules/Cluster.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"MaximumDynamicServerCount": [ {"version": "[12.1.2,)", "wlst_mode": "both", "wlst_name": "MaximumDynamicServerCount", "wlst_path": "WP001", "default_value": 0, "wlst_type": "integer", "get_method": "GET" } ],
3636
"MinDynamicClusterSize": [ {"version": "[12.2.1,)", "wlst_mode": "both", "wlst_name": "MinDynamicClusterSize", "wlst_path": "WP001", "default_value": 1, "wlst_type": "integer" } ],
3737
"Notes": [ {"version": "[12.1.2,)", "wlst_mode": "both", "wlst_name": "Notes", "wlst_path": "WP001", "default_value": null, "wlst_type": "string" } ],
38-
"ServerNamePrefix": [ {"version": "[12.1.2,)", "wlst_mode": "both", "wlst_name": "ServerNamePrefix", "wlst_path": "WP001", "default_value": null, "wlst_type": "string" } ],
38+
"ServerNamePrefix": [ {"version": "[12.1.2,)", "wlst_mode": "both", "wlst_name": "ServerNamePrefix", "wlst_path": "WP001", "default_value": null, "derived_default": "true", "wlst_type": "string" } ],
3939
"ServerNameStartingIndex": [ {"version": "[14.1.1,)", "wlst_mode": "both", "wlst_name": "ServerNameStartingIndex", "wlst_path": "WP001", "default_value": 1, "wlst_type": "integer" } ],
4040
"ServerTemplate": [ {"version": "[12.1.2,)", "wlst_mode": "both", "wlst_name": "ServerTemplate", "wlst_path": "WP001", "default_value": null, "wlst_type": "string", "get_method": "${LSA:GET}", "set_method": "MBEAN.set_server_template_mbean", "set_mbean_type": "weblogic.management.configuration.ServerTemplateMBean" } ],
4141
"WaitForAllSessionsDuringShutdown": [ {"version": "[12.2.1,)", "wlst_mode": "both", "wlst_name": "WaitForAllSessionsDuringShutdown", "wlst_path": "WP001", "default_value": "false", "wlst_type": "boolean" } ]
@@ -191,7 +191,7 @@
191191
"CoherenceClusterSystemResource": [ {"version": "[12.1.2,)", "wlst_mode": "both", "wlst_name": "CoherenceClusterSystemResource", "wlst_path": "WP001", "default_value": null, "wlst_type": "string", "get_method": "${LSA:GET}","set_method": "${:MBEAN.set_coherence_cluster_mbean}", "set_mbean_type": "${:weblogic.management.configuration.CoherenceClusterSystemResourceMBean}", "restart_required": "true" } ],
192192
"ConcurrentSingletonActivationEnabled": [ {"version": "[12.2.1.3,)", "wlst_mode": "both", "wlst_name": "ConcurrentSingletonActivationEnabled", "wlst_path": "WP001", "default_value": "false", "wlst_type": "boolean", "restart_required": "true" } ],
193193
"ConsensusParticipants": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "ConsensusParticipants", "wlst_path": "WP001", "default_value": 0, "wlst_type": "integer", "get_method": "GET" } ],
194-
"DataSourceForAutomaticMigration": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "DataSourceForAutomaticMigration", "wlst_path": "WP001", "default_value": "defaultCoherenceCluster", "wlst_type": "string", "get_method": "${LSA:GET}", "set_method": "MBEAN.set_data_source_mbean", "set_mbean_type": "weblogic.management.configuration.JDBCSystemResourceMBean", "restart_required": "true" } ],
194+
"DataSourceForAutomaticMigration": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "DataSourceForAutomaticMigration", "wlst_path": "WP001", "default_value": null, "wlst_type": "string", "get_method": "${LSA:GET}", "set_method": "MBEAN.set_data_source_mbean", "set_mbean_type": "weblogic.management.configuration.JDBCSystemResourceMBean", "restart_required": "true" } ],
195195
"DataSourceForJobScheduler": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "DataSourceForJobScheduler", "wlst_path": "WP001", "default_value": null, "wlst_type": "string", "set_method": "${:MBEAN.set_data_source_mbean}", "set_mbean_type": "${:weblogic.management.configuration.JDBCSystemResourceMBean}" } ],
196196
"DataSourceForSessionPersistence": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "DataSourceForSessionPersistence", "wlst_path": "WP001", "default_value": null, "wlst_type": "string", "set_method": "${:MBEAN.set_data_source_mbean}", "set_mbean_type": "${:weblogic.management.configuration.JDBCSystemResourceMBean}", "restart_required": "true" } ],
197197
"DatabaseLeasingBasisConnectionRetryCount": [ {"version": "[12.1.3,)", "wlst_mode": "both", "wlst_name": "DatabaseLeasingBasisConnectionRetryCount", "wlst_path": "WP001", "default_value": 1, "wlst_type": "integer", "get_method": "GET", "restart_required": "true" } ],

0 commit comments

Comments
 (0)