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
How can I set up an environment to test MySQL unit tests?
I didn't really understand from this documentation: link
What have I been doing:
1. I created the integration-test-cases.xml file
I created the resources/cases/dml/dml-integration-test-cases.xml file using the resources/cases/${SQL-TYPE}/${SQL-TYPE}-integration-test-cases.xml template and I wrote the code in this file:
<integration-test-cases><test-case sql="SELECT * FROM table_name WHERE column1 = ? AND column2 = ?"><assertion parameters="value_1:int, value_2:varchar" expected-data-file="expected_dataset_1.xml"/></test-case><test-case sql="INSERT INTO table_name (column1, column2) VALUES (?, ?)"><assertion parameters="value_3:int, value_4:varchar" expected-data-file="expected_dataset_2.xml"/></test-case><test-case sql="UPDATE table_name SET column1 = ? WHERE column2 = ?"><assertion parameters="value_5:int, value_6:varchar" expected-data-file="expected_dataset_3.xml"/></test-case><test-case sql="DELETE FROM table_name WHERE column1 = ?"><assertion parameters="value_7:int" expected-data-file="expected_dataset_4.xml"/></test-case></integration-test-cases>
2. Most likely the wrong item
The next step was to create a number of files using a template:
The lookup rule of expected-data-fileis as follows:
Find the file dataset\${SCENARIO_NAME}\${DATABASE_TYPE}\${dataset_file}.xml in the same level directory;
Find the file dataset\${SCENARIO_NAME}\${dataset_file}.xml in the same level directory;
Find the file dataset\${dataset_file}.xml in the same level directory;
Report an error if none of them are found.
I copied these created files and moved them to folders:
test\e2e\sql\src\test\resources\cases\dml\dataset\db
test\e2e\sql\src\test\resources\cases\dml\dataset
3. Created Native environment configuration
3. Next i created a directory: test\e2e\sql\src\test\resources\env\sharding_mysql and there are files in it:
4. Run the test engine
Next, I wanted to find the src/test/resources/env/engine-env.properties file, but it was not there, only the src\test\resources\env\it-
env.properties file
Next, I wanted to complete the point:
Standard test engine Run org.apache.shardingsphere.test.integration.engine.${SQL-TYPE}.General${SQL-TYPE}E2EIT to start the test engines of different SQL types.
But this folder also wasn't in my project.
What am I doing wrong, maybe there is more detailed documentation? I need to deploy this all for MySQL
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
How can I set up an environment to test MySQL unit tests?
I didn't really understand from this documentation: link
What have I been doing:
1. I created the integration-test-cases.xml file
I created the resources/cases/dml/dml-integration-test-cases.xml file using the resources/cases/${SQL-TYPE}/${SQL-TYPE}-integration-test-cases.xml template and I wrote the code in this file:2. Most likely the wrong item
The next step was to create a number of files using a template:
I copied these created files and moved them to folders:
test\e2e\sql\src\test\resources\cases\dml\dataset\db
test\e2e\sql\src\test\resources\cases\dml\dataset
3. Created Native environment configuration
3. Next i created a directory: test\e2e\sql\src\test\resources\env\sharding_mysql and there are files in it:4. Run the test engine
Next, I wanted to find the src/test/resources/env/engine-env.properties file, but it was not there, only the src\test\resources\env\it- env.properties fileNext, I wanted to complete the point:
But this folder also wasn't in my project.
What am I doing wrong, maybe there is more detailed documentation? I need to deploy this all for MySQL
Beta Was this translation helpful? Give feedback.
All reactions