Skip to content

Setup development environment

Rodel E. Dagumampan edited this page Feb 1, 2020 · 31 revisions

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

Prerequisites

Building the code

cd yuniql-cli
dotnet build

Publishing as self-contained application (win-x64)

cd yuniql-cli
dotnet publish -c release -r win-x64 /p:publishsinglefile=true /p:publishtrimmed=true

Publishing as self-contained application (linux-x64)

cd yuniql-cli
dotnet publish -c release -r linux-x64 /p:publishsinglefile=true /p:publishtrimmed=true

Running sqlserver-tests from shell/teminal

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!"

Running sql-server tests with docker-compose

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

Found bugs?

Help us improve further please create an issue.