Skip to content

Wdt 663 fix alias tests for reduce time #1210

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 23 commits into from
Oct 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
2efdfb8
add defaults and derived default flag
CarolynRountree Sep 29, 2022
dbebaf7
default value change
CarolynRountree Sep 30, 2022
8a7a0de
default value change
CarolynRountree Sep 30, 2022
30e522d
Update WLSDeployZipFile.java
CarolynRountree Sep 30, 2022
2536492
adding uses_path_tokens, where appropriate
robertpatrick Oct 5, 2022
8260712
Merge branch 'WDT-663-fix-alias-tests-for-reduce-time' of github.com:…
robertpatrick Oct 5, 2022
0d8aa62
fixing a broken unit test caused by adding uses_path_tokens to the Fi…
robertpatrick Oct 5, 2022
4db6db1
renaming the top-level system-test directory
robertpatrick Oct 5, 2022
298a322
Corrected error message key
rakillen Oct 5, 2022
3184b10
Merge remote-tracking branch 'origin/WDT-663-fix-alias-tests-for-redu…
rakillen Oct 5, 2022
423e205
fixing merge issues
robertpatrick Oct 5, 2022
895e167
another attempt to resolve the merge conflict
robertpatrick Oct 5, 2022
a0dbd86
Corrected token name
rakillen Oct 5, 2022
2b5f55d
Merge remote-tracking branch 'origin/WDT-663-fix-alias-tests-for-redu…
rakillen Oct 5, 2022
9267cd5
Fixed attributes with "None" values, server template date format and …
rakillen Oct 6, 2022
13bc495
Restored SecurityConfiguration PasswordDigestEnabled and ActiveType t…
rakillen Oct 7, 2022
15cfd8d
Fix for flattened folders without tokens in location
CarolynRountree Oct 7, 2022
063e8bf
Merge branch 'main' into WDT-663-fix-alias-tests-for-reduce-time
robertpatrick Oct 11, 2022
a794476
Merge branch 'WDT-663-fix-alias-tests-for-reduce-time' of github.com:…
robertpatrick Oct 11, 2022
1932273
moving alias-test directory
robertpatrick Oct 12, 2022
de9000c
Call is_set() on discover unless -remote command-line argument is pre…
rakillen Oct 26, 2022
d3b28a9
Merge branch 'main' into WDT-663-fix-alias-tests-for-reduce-time
rakillen Oct 26, 2022
a8a6138
Remove 'Alias Test' stage from Jenkinsfile
rakillen Oct 26, 2022
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
7 changes: 2 additions & 5 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,6 @@ pipeline {
steps {
sh 'mvn -B -DskipITs=false -Dmw_home=${ORACLE_HOME} -Ddb.use.container.network=true install'
}
post {
always {
junit 'system-test/integration-tests/target/failsafe-reports/*.xml'
}
}
}
stage ('Analyze') {
when {
Expand All @@ -89,6 +84,7 @@ pipeline {
}
}
}
/*
stage ('Alias Test') {
// only run this stage when triggered by a cron timer and the commit does not have []skip-ci in the message
// for example, only run integration tests during the timer triggered nightly build
Expand Down Expand Up @@ -130,6 +126,7 @@ pipeline {
}
}
}
*/
stage ('Save Nightly Installer'){
when {
allOf {
Expand Down
105 changes: 0 additions & 105 deletions alias-test/pom.xml

This file was deleted.

1 change: 1 addition & 0 deletions core/src/main/python/wlsdeploy/aliases/alias_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
CONTAINS = 'contains'
DEFAULT_NAME_VALUE = 'default_name_value'
DEFAULT_VALUE = 'default_value'
DERIVED_DEFAULT = 'derived_default'
FLATTENED_FOLDER_DATA = 'flattened_folder_data'
FOLDERS = 'folders'
FOLDER_ORDER = 'folder_order'
Expand Down
21 changes: 21 additions & 0 deletions core/src/main/python/wlsdeploy/aliases/aliases.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from wlsdeploy.aliases.alias_constants import ATTRIBUTES
from wlsdeploy.aliases.alias_constants import ChildFoldersTypes
from wlsdeploy.aliases.alias_constants import DEFAULT_VALUE
from wlsdeploy.aliases.alias_constants import DERIVED_DEFAULT
from wlsdeploy.aliases.alias_constants import FLATTENED_FOLDER_DATA
from wlsdeploy.aliases.alias_constants import FOLDERS
from wlsdeploy.aliases.alias_constants import GET
Expand Down Expand Up @@ -1297,6 +1298,26 @@ def decrypt_password(self, text):

return rtnval

def is_derived_default(self, location, model_attribute):
"""
Return whether the default is derived by WLST.
:param location: current location
:param model_attribute: model name of attribute to check
:return: True if the default is derived
"""
_method_name = "get_derived_default"
self._logger.entering(model_attribute, class_name=self._class_name, method_name=_method_name)
result = False
try:
attribute_info = self._alias_entries.get_alias_attribute_entry_by_wlst_name(location, model_attribute)
if attribute_info is not None and DERIVED_DEFAULT in attribute_info:
result = attribute_info[DERIVED_DEFAULT]
except AliasException, ae:
self._raise_exception(ae, _method_name, 'WLSDPLY-19045', model_attribute, location.get_folder_path(),
ae.getLocalizedMessage())
self._logger.exiting(class_name=self._class_name, method_name=_method_name, result=result)
return result

###########################################################################
# Convenience Methods #
###########################################################################
Expand Down
31 changes: 26 additions & 5 deletions core/src/main/python/wlsdeploy/tool/discover/discoverer.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def add_to_remote_map(self, local_name, archive_name, file_type):
if not os.path.isabs(local_name):
local_name = os.path.join(self._model_context.get_domain_home(), local_name)
# we don't know the remote machine type, so automatically turn into forward
# slashes.
# slashes.
local_name = local_name.replace('\\', '/')
remote_dict[local_name] = OrderedDict()
remote_dict[local_name][REMOTE_TYPE] = file_type
Expand Down Expand Up @@ -129,9 +129,15 @@ def _populate_model_parameters(self, dictionary, location):
wlst_value = wlst_lsa_params[wlst_lsa_param]

# if attribute was never set (online only), don't add to the model
if not self._wlst_helper.is_set(wlst_lsa_param):
_logger.finest('WLSDPLY-06157', wlst_lsa_param, str(location), class_name=_class_name,
method_name=_method_name)
try:

if self._omit_from_model(location, wlst_lsa_param):
_logger.finest('WLSDPLY-06157', wlst_lsa_param, str(location), class_name=_class_name,
method_name=_method_name)
continue
except DiscoverException, de:
_logger.info("WLSDPLY-06158", wlst_lsa_param, str(location), de.getLocalizedMessage(),
class_name=_class_name, method_name=_method_name)
continue

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

def _omit_from_model(self, location, wlst_lsa_param):
"""
Determine if the specified attribute should be omitted from the model.
Avoid calling wlst_helper.is_set() if possible, it slows down the online discovery process.
:param location: the location of the attribute to be examined
:param wlst_lsa_param: the name of the attribute to be examined
:return: True if attribute should be omitted, False otherwise
"""
# attributes with derived defaults need to call is_set(), since their value is dynamic.
# don't call is_set() if the -remote command-line argument is used.
if self._aliases.is_derived_default(location, wlst_lsa_param) or not self._model_context.is_remote():
# wlst_helper.is_set already checks for offline / online
return not self._wlst_helper.is_set(wlst_lsa_param)
return False

def _get_attribute_value_with_get(self, wlst_get_param, wlst_path):
_method_name = '_get_attribute_value_with_get'
_logger.finest('WLSDPLY-06104', wlst_get_param, class_name=_class_name, method_name=_method_name)
Expand All @@ -153,7 +174,7 @@ def _get_attribute_value_with_get(self, wlst_get_param, wlst_path):
wlst_value = self._wlst_helper.get(wlst_get_param)
success = True
except DiscoverException, pe:
_logger.warning('WLSDPLY-06127', wlst_get_param, wlst_path, pe.getLocalizedMessage(),
_logger.info('WLSDPLY-06127', wlst_get_param, wlst_path, pe.getLocalizedMessage(),
class_name=_class_name, method_name=_method_name)
return success, wlst_value

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def _get_required_attribute(self, dictionary, name, mapping_type, mapping_name):
result = dictionary_utils.get_element(dictionary, name)

if result is None:
pwe = exception_helper.create_exception(self._exception_type, '-01791', name, mapping_type,
pwe = exception_helper.create_exception(self._exception_type, 'WLSDPLY-01791', name, mapping_type,
mapping_name)
self._logger.throwing(class_name=self._class_name, method_name=_method_name, error=pwe)
raise pwe
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"Notes": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "Notes", "wlst_path": "WP001", "default_value": null, "wlst_type": "string" } ],
"OnDemandContextPaths": [ {"version": "[10,)", "wlst_mode": "online", "wlst_name": "OnDemandContextPaths", "wlst_path": "WP001", "default_value": "[]", "wlst_type": "jarray", "get_method": "GET", "access": "RO" } ],
"OnDemandDisplayRefresh": [ {"version": "[10,)", "wlst_mode": "online", "wlst_name": "OnDemandDisplayRefresh", "wlst_path": "WP001", "default_value": "false", "wlst_type": "boolean", "get_method": "GET", "access": "RO" } ],
"ParallelDeployModules": [ {"version": "[12.2.1,)", "wlst_mode": "both", "wlst_name": "ParallelDeployModules", "wlst_path": "WP001", "default_value": "false", "wlst_type": "boolean" } ],
"ParallelDeployModules": [ {"version": "[12.2.1,)", "wlst_mode": "both", "wlst_name": "ParallelDeployModules", "wlst_path": "WP001", "default_value": "false", "derived_default": "true", "wlst_type": "boolean" } ],
"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" } ],
"PlanDir": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "PlanDir", "wlst_path": "WP001", "default_value": null, "wlst_type": "string", "access": "${:ROD}", "uses_path_tokens": "true" } ],
"PlanPath": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "PlanPath", "wlst_path": "WP001", "default_value": null, "wlst_type": "string", "access": "${:ROD}", "uses_path_tokens": "true" } ],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"attributes": {
"ImplicitBeanDiscoveryEnabled": [ {"version": "[12.2.1,)", "wlst_mode": "both", "wlst_name": "ImplicitBeanDiscoveryEnabled", "wlst_path": "WP001", "default_value": "true", "wlst_type": "boolean" } ],
"Notes": [ {"version": "[12.2.1,)", "wlst_mode": "both", "wlst_name": "Notes", "wlst_path": "WP001", "default_value": null, "wlst_type": "string" } ],
"Policy": [ {"version": "[12.2.1.1,)", "wlst_mode": "both", "wlst_name": "Policy", "wlst_path": "WP001", "default_value": null, "wlst_type": "string" } ]
"Policy": [ {"version": "[12.2.1.1,)", "wlst_mode": "both", "wlst_name": "Policy", "wlst_path": "WP001", "default_value": "${__NULL__:Enabled}", "wlst_type": "string" } ]
},
"wlst_attributes_path": "WP001",
"wlst_paths": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"MaximumDynamicServerCount": [ {"version": "[12.1.2,)", "wlst_mode": "both", "wlst_name": "MaximumDynamicServerCount", "wlst_path": "WP001", "default_value": 0, "wlst_type": "integer", "get_method": "GET" } ],
"MinDynamicClusterSize": [ {"version": "[12.2.1,)", "wlst_mode": "both", "wlst_name": "MinDynamicClusterSize", "wlst_path": "WP001", "default_value": 1, "wlst_type": "integer" } ],
"Notes": [ {"version": "[12.1.2,)", "wlst_mode": "both", "wlst_name": "Notes", "wlst_path": "WP001", "default_value": null, "wlst_type": "string" } ],
"ServerNamePrefix": [ {"version": "[12.1.2,)", "wlst_mode": "both", "wlst_name": "ServerNamePrefix", "wlst_path": "WP001", "default_value": null, "wlst_type": "string" } ],
"ServerNamePrefix": [ {"version": "[12.1.2,)", "wlst_mode": "both", "wlst_name": "ServerNamePrefix", "wlst_path": "WP001", "default_value": null, "derived_default": "true", "wlst_type": "string" } ],
"ServerNameStartingIndex": [ {"version": "[14.1.1,)", "wlst_mode": "both", "wlst_name": "ServerNameStartingIndex", "wlst_path": "WP001", "default_value": 1, "wlst_type": "integer" } ],
"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" } ],
"WaitForAllSessionsDuringShutdown": [ {"version": "[12.2.1,)", "wlst_mode": "both", "wlst_name": "WaitForAllSessionsDuringShutdown", "wlst_path": "WP001", "default_value": "false", "wlst_type": "boolean" } ]
Expand Down Expand Up @@ -191,7 +191,7 @@
"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" } ],
"ConcurrentSingletonActivationEnabled": [ {"version": "[12.2.1.3,)", "wlst_mode": "both", "wlst_name": "ConcurrentSingletonActivationEnabled", "wlst_path": "WP001", "default_value": "false", "wlst_type": "boolean", "restart_required": "true" } ],
"ConsensusParticipants": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "ConsensusParticipants", "wlst_path": "WP001", "default_value": 0, "wlst_type": "integer", "get_method": "GET" } ],
"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" } ],
"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" } ],
"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}" } ],
"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" } ],
"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" } ],
Expand Down
Loading