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
After that, the quickest way to get setup for development is to use [Docker](https://www.docker.com/). Assuming you have [downloaded docker](https://www.docker.com/products/docker) for your platform, you can use [docker-compose](https://docs.docker.com/compose/install/) to run the necessary containers for testing.
404
+
After that, the quickest way to get setup for development is to use the provided devcontainers setup.
405
405
406
406
```shell
407
-
$ docker-compose up -d
407
+
npm install -g @devcontainers/cli
408
+
devcontainer up --workspace-folder .
409
+
devcontainer exec --workspace-folder . bash
408
410
```
409
411
410
-
This will download the official SQL Server for Linux Docker image from [Microsoft](https://hub.docker.com/r/microsoft/mssql-server-linux/). This will also download a [toxiproxy](https://github.com/shopify/toxiproxy) Docker image which we can use to simulate network failures for tests. Basically, it does the following:
412
+
From within the container, you can run the tests using the following command:
Make sure to run these SQL scripts as SA to get the test database and user installed. If needed, install [sqlcmd as described by Microsoft for your platform](https://learn.microsoft.com/en-us/sql/tools/sqlcmd/sqlcmd-utility?view=sql-server-ver16&tabs=go%2Clinux&pivots=cs1-bash).
419
+
You can customize the environment variables to run the tests against a different environment
421
420
422
-
```shell
423
-
/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P super01S3cUr3 -i ./test/sql/db-create.sql
424
-
/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P super01S3cUr3 -i ./test/sql/db-login.sql
425
-
```
426
-
427
-
From here you can build and run tests against an installed version of FreeTDS.
428
-
429
-
```shell
430
-
$ bundle install
431
-
$ bundle exec rake
432
-
```
433
-
434
-
Examples us using enviornment variables to customize the test task.
rake test TINYTDS_UNIT_DATASERVER=mydbserver TINYTDS_SCHEMA=sqlserver_2017
423
+
rake test TINYTDS_UNIT_HOST=mydb.host.net TINYTDS_SCHEMA=sqlserver_azure
440
424
```
441
425
442
426
### Code formatting
@@ -450,7 +434,7 @@ We are using `standardrb` to format the Ruby code and Artistic Style for the C c
450
434
451
435
For the convenience, TinyTDS ships pre-compiled gems for supported versions of Ruby on Windows and Linux. In order to generate these gems, [rake-compiler-dock](https://github.com/rake-compiler/rake-compiler-dock) is used.
452
436
453
-
Run the following rake task to compile the gems. This will check the availability of [Docker](https://www.docker.com/) and will give some advice for download and installation. When docker is running, it will download the docker image (once-only) and start the build:
437
+
Run the following rake task to compile the gems. You can run these commands from inside the devcontainers setup, or outside if neeed. The command will check the availability of [Docker](https://www.docker.com/) and will give some advice for download and installation. When docker is running, it will download the docker image (once-only) and start the build:
0 commit comments