You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Compare the result set returned by executing a SQL statement between a distributed database and a traditional relational database.(Temporarily replace the middleware with MySQL, that is, compare MySQL with MySQL,MySQL version is 5.7.21)
Use tutorial (only select is supported for the time being, take test_case as an example)
Create sql folder (such as test) under src / sqls.Write the corresponding sql file (One SQL statement in the file corresponds to one line. Line breaks are not supported. Each statement ends with a ';'. All lines are commented.)
Create a folder in the src / features directory (such as test)
Write a behave.ini (see the official documentation for the specific parameters, and generally only modify the path of the log)
Write a .feature file and pass in the sql folder path (such as testCase.feature)
Feature: begin a test case# Enter feature description hereScenario: test case When midware and mysql test case | path | |../../sqls/test/select|
Write a .py file (such as testCase.py)
from behave import *from suiteCore import *@When('midware and mysql test case')def step_impl(context): for row in context.table: assert compareSQLResult(row['path']) == 1
sort:
The end of the sql statement ';' followed by 1 means that the client is not required to perform ascending sorting, and sorting is required by default.
It should be noted that the sql_path here is a relative path, and the current path is the path where the behave is executed. In this case, the current path is src / features / test, not the path src / features / steps where the py file is located.
About
Testing the result set of a distributed database node.(mysql)