Skip to content

Latest commit

 

History

History
87 lines (71 loc) · 5.14 KB

File metadata and controls

87 lines (71 loc) · 5.14 KB

Install the tSQLt build

Software pre-requisites

In order to be able to run the build and automated tests locally, you need to install following software:

Instructions

  1. Set system environment variables. You can do it either in command prompt (elevated mode is needed)

Paths given as example, change it to the valid locations

Trailing slashes are not allowed

setx AntHome "%PROGRAMDATA%\chocolatey\lib\ant\tools\apache-ant-1.10.9" /M
setx NET4Home "%WINDIR%\Microsoft.NET\Framework\v4.0.30319" /M
setx SQLCMDPath "%PROGRAMFILES%\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn" /M

or

  • Open File Explorer window (WinKey + E)

  • Click on the Path Bar (behind the current path, not on) or Alt + D

    Path Bar in Windows Explorer

  • Type in Control Panel\System and Security\System

  • Hit Return

  • Select Advanced system settings

    Advanced system settings

  • Click on Environment Variables… button

    Environment Variables Button

  • Create 3 new system variables (note that paths should exist, you might need to change them for your setup)

    Variable Value
    AntHome %PROGRAMDATA%\chocolatey\lib\ant\tools\apache-ant-1.10.9
    NET4Home %WINDIR%\Microsoft.NET\Framework\v4.0.30319
    SQLCMDPath %PROGRAMFILES%\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn

    Environment variables

  1. Enable TCP connection on SQL Server Instance. Follow these instructions

  2. Create instance alias Dev_tSQLt to localhost (optional). You can use either Sql Server Configuration Manager or TCP alias in cliconfig.exe (C:\Windows\SysWOW64\cliconfig.exe, C:\Windows\System32\cliconfig.exe)

    • Open Sql Server Configuration Manager
    • Navigate to SQL Native Client 11.0 Configuration --> Aliases and/or SQL Native Client 11.0 Configuration (32bit) --> Aliases (you can add them both if you are not sure)
    • Fill Dev_tSQLt as Alias Name and port if it is not default one

    Aliases

  3. git clone tSQLt Sources https://github.com/tSQLt-org/tSQLt.git

  4. If you do not have access to the original key (probably not), create self-signed key without password, using Strong Name Tool (sn.exe). You can run .\tSQLtCLR\OfficialSigningKey\InstallSigningKey.bat

  5. Re-start SSMS (if it was open)

  6. Go to Tools --> External Tools, tick Use Output Window and fill:

    Property Value
    Title tSQLt local Dev_tSQLt
    Command $(SolutionDir)\Build\LocalBuild.bat
    Arguments %AntHome% %Net4Home% "%SQLCMDPath%" Dev_tSQLt tSQLt_dev
    Initial directory $(SolutionDir)
    External Tools
  7. Open the solution File --> Open --> Project/Solution or Ctrl + Shift + O and choose tSQLt.ssmssln file

  8. Run the build Tools --> tSQLt local Dev_tSQLt Run Build

If everything was done correctly you should see in the output window:

BUILD SUCCESSFUL
Total time: 1 minute 19 seconds
+-------------------------+
:     BUILD SUCCEEDED     :
+-------------------------+

Troubleshooting

Try to run Build\TestEnvironment.ps1 script to test your environment setup