ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From srima...@apache.org
Subject ambari git commit: AMBARI-10658. Refactor stack-config's 'property_depended_by' information into a sub-resource - test fixes (dsen via srimanth)
Date Fri, 24 Apr 2015 21:17:56 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 3b9073e46 -> ac9679983


AMBARI-10658. Refactor stack-config's 'property_depended_by' information into a sub-resource
- test fixes (dsen via srimanth)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/ac967998
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/ac967998
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/ac967998

Branch: refs/heads/trunk
Commit: ac96799834cbc500d42160c64be8db269af3bcc1
Parents: 3b9073e
Author: Srimanth Gunturi <sgunturi@hortonworks.com>
Authored: Fri Apr 24 14:17:35 2015 -0700
Committer: Srimanth Gunturi <sgunturi@hortonworks.com>
Committed: Fri Apr 24 14:17:40 2015 -0700

----------------------------------------------------------------------
 .../src/test/python/TestStackAdvisor.py         | 89 ++++++++++++--------
 .../stack_config_properties_mapper_test.js      | 20 +++--
 2 files changed, 63 insertions(+), 46 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/ac967998/ambari-server/src/test/python/TestStackAdvisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/TestStackAdvisor.py b/ambari-server/src/test/python/TestStackAdvisor.py
index a1818d7..149ae1d 100644
--- a/ambari-server/src/test/python/TestStackAdvisor.py
+++ b/ambari-server/src/test/python/TestStackAdvisor.py
@@ -399,23 +399,28 @@ class TestStackAdvisorInitialization(TestCase):
                 ],
                 "property_name" : "yarn.nodemanager.resource.cpu-vcores",
                 "type" : "yarn-site.xml"
-              }
+              },
+             "dependencies": []
             },
             {
               "StackConfigurations" : {
-                "property_depended_by" : [
-                  {
-                    "type" : "yarn-site",
-                    "name" : "yarn.scheduler.maximum-allocation-mb"
-                  },
-                  {
-                    "type" : "yarn-site",
-                    "name" : "yarn.scheduler.minimum-allocation-mb"
-                  }
-                ],
                 "property_name" : "yarn.nodemanager.resource.memory-mb",
                 "type" : "yarn-site.xml"
-              }
+              },
+             "dependencies": [
+                {
+                  "StackConfigurationDependency" : {
+                    "dependency_name": "yarn.scheduler.maximum-allocation-mb",
+                    "dependency_type": "yarn-site"
+                  }
+                },
+                {
+                  "StackConfigurationDependency" : {
+                    "dependency_name": "yarn.scheduler.minimum-allocation-mb",
+                    "dependency_type": "yarn-site"
+                  }
+                },
+              ]
             },
             {
               "StackConfigurations" : {
@@ -435,45 +440,55 @@ class TestStackAdvisorInitialization(TestCase):
                 ],
                 "property_name" : "yarn.scheduler.maximum-allocation-mb",
                 "type" : "yarn-site.xml"
-              }
+              },
+             "dependencies": []
             },
             {
               "StackConfigurations" : {
                 "property_depended_by" : [ ],
                 "property_name" : "yarn.scheduler.maximum-allocation-vcores",
                 "type" : "yarn-site.xml"
-              }
+              },
+             "dependencies": []
             },
             {
               "StackConfigurations" : {
-                "property_depended_by" : [
-                  {
-                    "type" : "hive-site",
-                    "name" : "hive.tez.container.size"
-                  },
-                  {
-                    "type" : "mapred-site",
-                    "name" : "yarn.app.mapreduce.am.resource.mb"
-                  },
-                  {
-                    "type" : "mapred-site",
-                    "name" : "mapreduce.map.memory.mb"
-                  },
-                  {
-                    "type" : "mapred-site",
-                    "name" : "mapreduce.reduce.memory.mb"
-                  }
-                ],
                 "property_name" : "yarn.scheduler.minimum-allocation-mb",
                 "type" : "yarn-site.xml"
-              }
+              },
+             "dependencies": [
+                {
+                  "StackConfigurationDependency" : {
+                    "dependency_name": "hive.tez.container.size",
+                    "dependency_type": "hive-site"
+                  }
+                },
+                {
+                  "StackConfigurationDependency" : {
+                    "dependency_name": "yarn.app.mapreduce.am.resource.mb",
+                    "dependency_type": "mapred-site"
+                  }
+                },
+                {
+                  "StackConfigurationDependency" : {
+                    "dependency_name": "mapreduce.map.memory.mb",
+                    "dependency_type": "mapred-site"
+                  }
+                },
+                {
+                  "StackConfigurationDependency" : {
+                    "dependency_name": "mapreduce.reduce.memory.mb",
+                    "dependency_type": "mapred-site"
+                  }
+                },
+              ]
             },
             {
               "StackConfigurations" : {
-                "property_depended_by" : [ ],
                 "property_name" : "yarn.scheduler.minimum-allocation-vcores",
                 "type" : "yarn-site.xml"
-              }
+              },
+             "dependencies": []
             }
           ]
         }
@@ -490,9 +505,9 @@ class TestStackAdvisorInitialization(TestCase):
     properties_dict = default_stack_advisor.getAffectedConfigs(services)
     expected_properties_dict = [{'name': 'yarn.scheduler.maximum-allocation-mb', 'type':
'yarn-site'},
                                 {'name': 'yarn.scheduler.minimum-allocation-mb', 'type':
'yarn-site'},
+                                {'name': 'hive.tez.container.size', 'type': 'hive-site'},
                                 {'name': 'yarn.app.mapreduce.am.resource.mb', 'type': 'mapred-site'},
                                 {'name': 'mapreduce.map.memory.mb', 'type': 'mapred-site'},
-                                {'name': 'mapreduce.reduce.memory.mb', 'type': 'mapred-site'},
-                                {'name': 'hive.tez.container.size', 'type': 'hive-site'}]
+                                {'name': 'mapreduce.reduce.memory.mb', 'type': 'mapred-site'}]
 
     self.assertEquals(properties_dict, expected_properties_dict)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/ac967998/ambari-web/test/mappers/configs/stack_config_properties_mapper_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/mappers/configs/stack_config_properties_mapper_test.js b/ambari-web/test/mappers/configs/stack_config_properties_mapper_test.js
index 6b7d0e4..2a1aa4b 100644
--- a/ambari-web/test/mappers/configs/stack_config_properties_mapper_test.js
+++ b/ambari-web/test/mappers/configs/stack_config_properties_mapper_test.js
@@ -57,14 +57,16 @@ describe('App.stackConfigPropertiesMapper', function () {
                 "minimum": "512",
                 "maximum": "10240",
                 "unit": "MB"
-              },
-              "property_depended_by": [
-                {
-                  "property_type": "site4",
-                  "property_name": "p4"
+              }
+            },
+            "dependencies": [
+              {
+                "StackConfigurationDependency" : {
+                  "dependency_name" : "p4",
+                  "dependency_type" : "site4",
                 }
-              ]
-            }
+              }
+            ]
           }
         ]
       },
@@ -153,8 +155,8 @@ describe('App.stackConfigPropertiesMapper', function () {
       expect(App.StackConfigProperty.find('p1_site1').get('fileName')).to.eql('site1.xml');
       expect(App.StackConfigProperty.find('p1_site1').get('propertyDependedBy')).to.eql([
         {
-          "property_type": "site4",
-          "property_name": "p4"
+          "type": "site4",
+          "name": "p4"
         }
       ]);
       expect(App.StackConfigProperty.find('p1_site1').get('valueAttributes')).to.eql({


Mime
View raw message