yuniql
yuniql copied to clipboard
Run all tests in one go
When testing new features or verifying the stability of the change, all tests in each supported platform must pass. Doing this today, we have to switch all the environment variables for each platform we are testing.
A more sustainable way is to run all these tests in one go. Such than we only need to issue dotnet test
all tests are executed in all our supported platforms.
Running platform tests for SqlServer
-
Always start by publishing Yuniql CLI (yuniql.exe) locally
cd C:\play\yuniql\yuniql-cli dotnet build dotnet publish -c release -r win-x64 /p:publishsinglefile=true /p:publishtrimmed=true
-
Configure your connection string
SETX YUNIQL_TEST_TARGET_PLATFORM "sqlserver" SETX YUNIQL_TEST_CONNECTION_STRING "Server=localhost,1400;Database=yuniqldb;User Id=SA;Password=P@ssw0rd!" SETX YUNIQL_TEST_SAMPLEDB "C:\play\yuniql\samples\basic-sqlserver-sample" SETX YUNIQL_TEST_CLI "C:\play\yuniql\yuniql-cli\bin\release\netcoreapp3.0\win-x64\publish" SETX YUNIQL_TEST_HOST "LOCAL"
You can also run the batch file
setup_test_envs_sqlserver.bat
register all these variables. The batch file is placed inyuniql-tests\platform-tests
directory. -
Run the platform tests
cd C:\play\yuniql\yuniql-tests\platform-tests dotnet build dotnet test -v n
Running platform tests for PostgreSql plugin
-
Configure your connection string
cd yuniql-platforms\postgresql dotnet publish -c release -r win-x64 SETX YUNIQL_TEST_TARGET_PLATFORM "postgresql" SETX YUNIQL_TEST_CONNECTION_STRING "Host=localhost;Port=5432;Username=sa;Password=P@ssw0rd!;Database=yuniqldb" SETX YUNIQL_TEST_SAMPLEDB "C:\play\yuniql\samples\basic-postgresql-sample" SETX YUNIQL_TEST_CLI "C:\play\yuniql\yuniql-cli\bin\release\netcoreapp3.0\win-x64\publish" SETX YUNIQL_TEST_HOST "LOCAL"
You can also run the batch file
setup_test_envs_mysql.bat
register all these variables. The batch file is placed inyuniql-tests\platform-tests
directory. -
Run the platform tests
cd C:\play\yuniql\yuniql-tests\platform-tests dotnet build dotnet test -v n
Running platform tests for MySql plugin
-
Configure your connection string
cd yuniql-platforms\mysql dotnet publish -c release -r win-x64 SETX YUNIQL_TEST_TARGET_PLATFORM "mysql" SETX YUNIQL_TEST_CONNECTION_STRING "Server=localhost;Port=3306;Database=yuniqldb;Uid=root;Pwd=P@ssw0rd!;" SETX YUNIQL_TEST_SAMPLEDB "C:\play\yuniql\samples\basic-mysql-sample" SETX YUNIQL_TEST_CLI "C:\play\yuniql\yuniql-cli\bin\release\netcoreapp3.0\win-x64\publish" SETX YUNIQL_TEST_HOST "LOCAL"
You can also run the batch file
setup_test_envs_mysql.bat
register all these variables. The batch file is placed inyuniql-tests\platform-tests
directory. -
Run the platform tests
cd C:\play\yuniql\yuniql-tests\platform-tests dotnet build dotnet test -v n
Hi @rdagumampan Can I submit a PR for this issue ? We can plan a discussion about the process to launch unit test in one step
You are very much welcome to submit a PR 👍 Thanks!