-
Notifications
You must be signed in to change notification settings - Fork 64
Setup development environment
Yuniql solution can be built from main solution file Yuniql.sln. When running platform tests, you need to set required environment variables first. The table describe the purpose of each directory.
Solution/Directory | Description |
---|---|
Yuniql.sln | The main solution to build Yuniql CLI with default support for SqlServer. The unit tests and extensibility interfaces for building plugins are here. |
yuniql-extensibility | |
yuniql-core | |
yuniql-platforms | The individual solution folders for plugins to support non-sql server databases. Here we can build PostgreSql and MySql plugins and use Yuniql.PlatformTests to verify. |
yuniql-tests | |
yuniql-cli |
Solution/Directory | Description |
---|---|
yuniql-aspnetcore | The solution folder for supporting yuniql migrations in ASP.NET Core projects. |
yuniql-distribution | |
yuniql-azure-pipelines |
- .NET Core 3.0 SDK
- VS Code / Visual Studio 2019
- Docker Desktop, its much easier to run platform tests with containerized databases! :)
cd yuniql-cli
dotnet build
cd yuniql-cli
dotnet publish -c release -r win-x64 /p:publishsinglefile=true /p:publishtrimmed=true
cd yuniql-cli
dotnet publish -c release -r linux-x64 /p:publishsinglefile=true /p:publishtrimmed=true
The following tests assumes you have an environment variable YUNIQL_CONNECTION_STRING
. If the env variable is not present, it will be default into Server=localhost,1400;Database={databaseName};User Id=SA;Password=P@ssw0rd!
where the database name is replaced by each test case id.
cd yuniql-tests
dotnet build
dotnet test -v n
You may also run the following commands to instantiate a containerized sql server
docker run -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=P@ssw0rd!" -p 1400:1433 -d mcr.microsoft.com/mssql/server:2017-latest
SETX YUNIQL_CONNECTION_STRING "Server=localhost,1400;Database=HelloYuniqlDb;User Id=SA;Password=P@ssw0rd!"
The following commands deploys a stack of two containers; db
and test
. It creates an SQL Server - Developer Edition on a linux container and creates a test container to run yuniql integration tests.
docker-compose down
docker-compose build --no-cache
docker-compose up
Help us improve further please create an issue.