Add Reverse Engineered SQL tests for Rules. Fixes #4600

This commit is contained in:
Akshay Joshi
2019-08-21 16:06:05 +05:30
parent 41e2a674e3
commit 094e5577e8
16 changed files with 272 additions and 14 deletions

View File

@@ -194,6 +194,18 @@ class ReverseEngineeredSQLTestCases(BaseTestGenerator):
"... skipped (pre-condition SQL not satisfied)")
continue
# If msql_endpoint exists then validate the modified sql
if 'msql_endpoint' in scenario\
and scenario['msql_endpoint']:
if not self.check_msql(scenario, object_id):
print_msg = scenario['name']
if 'expected_msql_file' in scenario:
print_msg += " Expected MSQL File:" + scenario[
'expected_msql_file']
print_msg = print_msg + "... FAIL"
print(print_msg)
continue
if 'type' in scenario and scenario['type'] == 'create':
# Get the url and create the specific node.
@@ -253,18 +265,6 @@ class ReverseEngineeredSQLTestCases(BaseTestGenerator):
elif 'type' in scenario and scenario['type'] == 'alter':
# Get the url and create the specific node.
# If msql_endpoint exists then validate the modified sql
if 'msql_endpoint' in scenario\
and scenario['msql_endpoint']:
if not self.check_msql(scenario, object_id):
print_msg = scenario['name']
if 'expected_msql_file' in scenario:
print_msg += " Expected MSQL File:" + scenario[
'expected_msql_file']
print_msg = print_msg + "... FAIL"
print(print_msg)
continue
alter_url = self.get_url(scenario['endpoint'], object_id)
response = self.tester.put(alter_url,
data=json.dumps(scenario['data']),
@@ -397,7 +397,7 @@ class ReverseEngineeredSQLTestCases(BaseTestGenerator):
return False
else:
try:
self.assertFalse("Expected SQL File not found")
self.assertFalse("Expected Modified SQL File not found")
except Exception as e:
self.final_test_status = False
traceback.print_exc()