Skip to content

Commit 4a3418c

Browse files
authored
Fixing v1.18.X compiler warnings (#172)
* removing annoying TLS match errors from stderr * upgrade dependencies versions to avoid elixir compiler 1.18 warnings about obsolete quotes for char lists * upgrading GH runner image to ubuntu 22.04, mssql-tools to v18 and min supported elixir + OTP version to 1.14 + 24.3
1 parent 4ab67e7 commit 4a3418c

11 files changed

Lines changed: 65 additions & 57 deletions

File tree

.github/workflows/elixir.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
jobs:
1010
tests:
1111
name: Unit Tests
12-
runs-on: ubuntu-20.04
12+
runs-on: ubuntu-22.04
1313
services:
1414
mssql:
1515
image: mcr.microsoft.com/${{ matrix.mssql.version }}
@@ -27,20 +27,20 @@ jobs:
2727
- version: "mssql/server:2022-latest"
2828
- version: "azure-sql-edge:latest"
2929
pair:
30-
- otp: 23.3
31-
elixir: 1.13.4
30+
- otp: 24.3
31+
elixir: 1.14.3
3232
include:
3333
- mssql:
3434
version: "mssql/server:2022-latest"
3535
pair:
36-
otp: 24.3
37-
elixir: 1.14.4
36+
otp: 25.3
37+
elixir: 1.18.4
3838
lint: lint
3939
- mssql:
4040
version: "mssql/server:2022-latest"
4141
pair:
42-
otp: 23.3
43-
elixir: 1.13.4
42+
otp: 24.3
43+
elixir: 1.14.3
4444
lint: skip_lint
4545

4646
env:
@@ -51,8 +51,10 @@ jobs:
5151
steps:
5252
- name: Install MSSql Client Tools
5353
run: |
54+
curl https://packages.microsoft.com/keys/microsoft.asc | sudo tee /etc/apt/trusted.gpg.d/microsoft.asc
55+
curl https://packages.microsoft.com/config/ubuntu/22.04/prod.list | sudo tee /etc/apt/sources.list.d/mssql-release.list
5456
sudo apt-get update
55-
sudo apt-get install -y mssql-tools unixodbc-dev
57+
sudo apt-get install mssql-tools18 unixodbc-dev
5658
5759
- uses: actions/checkout@v2
5860

@@ -87,5 +89,5 @@ jobs:
8789

8890
- name: Run Tests
8991
run: |
90-
export PATH=/opt/mssql-tools/bin:$PATH
92+
export PATH=/opt/mssql-tools18/bin:$PATH
9193
mix test

lib/tds/protocol.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ defmodule Tds.Protocol do
186186
after
187187
Process.delete(:resultset)
188188

189-
unless is_nil(handle) do
189+
if not is_nil(handle) do
190190
handle_close(query, opts, %{s | state: :executing})
191191
end
192192
end

lib/tds/tls.ex

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,30 +31,34 @@ defmodule Tds.Tls do
3131
end
3232

3333
def controlling_process(socket, tls_conn_pid) do
34-
socket
35-
|> assert_connected!()
36-
|> GenServer.call({:controlling_process, tls_conn_pid})
34+
case assert_connected!(socket) do
35+
:closed -> {:error, :closed}
36+
pid -> GenServer.call(pid, {:controlling_process, tls_conn_pid})
37+
end
3738
end
3839

3940
def send(socket, payload) do
40-
socket
41-
|> assert_connected!()
42-
|> GenServer.call({:send, payload})
41+
case assert_connected!(socket) do
42+
:closed -> {:error, :closed}
43+
pid -> GenServer.call(pid, {:send, payload})
44+
end
4345
end
4446

4547
def recv(socket, length, timeout \\ :infinity) do
46-
socket
47-
|> assert_connected!()
48-
|> GenServer.call({:recv, length, timeout}, timeout)
48+
case assert_connected!(socket) do
49+
:closed -> {:error, :closed}
50+
pid -> GenServer.call(pid, {:recv, length, timeout}, timeout)
51+
end
4952
end
5053

5154
defdelegate getopts(port, options), to: :inet
5255

5356
# defdelegate setopts(socket, options), to: :inet
5457
def setopts(socket, options) do
55-
socket
56-
|> assert_connected!()
57-
|> GenServer.call({:setopts, options})
58+
case assert_connected!(socket) do
59+
:closed -> {:error, :closed}
60+
pid -> GenServer.call(pid, {:setopts, options})
61+
end
5862
end
5963

6064
defdelegate peername(socket), to: :inet
@@ -81,10 +85,12 @@ defmodule Tds.Tls do
8185
defdelegate unquote(name)(arg1, arg2, arg3, arg4), to: :gen_tcp
8286
end)
8387

84-
# Asserts that the port / socket is still open and returns its `pid`
88+
# Asserts that the port / socket is still open and returns its `pid` or :error atom for closed connections
8589
defp assert_connected!(socket) do
86-
{:connected, pid} = Port.info(socket, :connected)
87-
pid
90+
case Port.info(socket, :connected) do
91+
{:connected, pid} -> pid
92+
nil -> :closed
93+
end
8894
end
8995

9096
# SERVER

mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ defmodule Tds.Mixfile do
3535
[
3636
{:decimal, "~> 1.9 or ~> 2.0"},
3737
{:jason, "~> 1.0", optional: true},
38-
{:db_connection, "~> 2.0"},
38+
{:db_connection, "~> 2.1"},
3939
{:ex_doc, "~> 0.19", only: :docs},
4040
{:excoding, "~> 0.1", optional: true, only: :test},
4141
{:tzdata, "~> 1.0", optional: true, only: :test},

mix.lock

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
%{
2-
"castore": {:hex, :castore, "1.0.7", "b651241514e5f6956028147fe6637f7ac13802537e895a724f90bf3e36ddd1dd", [:mix], [], "hexpm", "da7785a4b0d2a021cd1292a60875a784b6caef71e76bf4917bdee1f390455cf5"},
3-
"certifi": {:hex, :certifi, "2.9.0", "6f2a475689dd47f19fb74334859d460a2dc4e3252a3324bd2111b8f0429e7e21", [:rebar3], [], "hexpm", "266da46bdb06d6c6d35fde799bcb28d36d985d424ad7c08b5bb48f5b5cdd4641"},
4-
"db_connection": {:hex, :db_connection, "2.5.0", "bb6d4f30d35ded97b29fe80d8bd6f928a1912ca1ff110831edcd238a1973652c", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "c92d5ba26cd69ead1ff7582dbb860adeedfff39774105a4f1c92cbb654b55aa2"},
5-
"decimal": {:hex, :decimal, "2.0.0", "a78296e617b0f5dd4c6caf57c714431347912ffb1d0842e998e9792b5642d697", [:mix], [], "hexpm", "34666e9c55dea81013e77d9d87370fe6cb6291d1ef32f46a1600230b1d44f577"},
6-
"earmark_parser": {:hex, :earmark_parser, "1.4.33", "3c3fd9673bb5dcc9edc28dd90f50c87ce506d1f71b70e3de69aa8154bc695d44", [:mix], [], "hexpm", "2d526833729b59b9fdb85785078697c72ac5e5066350663e5be6a1182da61b8f"},
7-
"ex_doc": {:hex, :ex_doc, "0.30.6", "5f8b54854b240a2b55c9734c4b1d0dd7bdd41f71a095d42a70445c03cf05a281", [:mix], [{:earmark_parser, "~> 1.4.31", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "bd48f2ddacf4e482c727f9293d9498e0881597eae6ddc3d9562bd7923375109f"},
8-
"excoding": {:hex, :excoding, "0.1.2", "b37bd9a83cde9d11827bb0d2bc5630d262403a5d7a23cd6b6fa75dae21775d19", [:mix], [{:rustler, ">= 0.0.0", [hex: :rustler, repo: "hexpm", optional: true]}, {:rustler_precompiled, "~> 0.5", [hex: :rustler_precompiled, repo: "hexpm", optional: false]}], "hexpm", "c87e898072a03be192b433ee666b5423635e1b1891edd5dfeef32e845f846284"},
9-
"hackney": {:hex, :hackney, "1.18.1", "f48bf88f521f2a229fc7bae88cf4f85adc9cd9bcf23b5dc8eb6a1788c662c4f6", [:rebar3], [{:certifi, "~>2.9.0", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "~>6.1.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "~>1.0.0", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~>1.1", [hex: :mimerl, repo: "hexpm", optional: false]}, {:parse_trans, "3.3.1", [hex: :parse_trans, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "~>1.1.0", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}, {:unicode_util_compat, "~>0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "a4ecdaff44297e9b5894ae499e9a070ea1888c84afdd1fd9b7b2bc384950128e"},
10-
"idna": {:hex, :idna, "6.1.1", "8a63070e9f7d0c62eb9d9fcb360a7de382448200fbbd1b106cc96d3d8099df8d", [:rebar3], [{:unicode_util_compat, "~>0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "92376eb7894412ed19ac475e4a86f7b413c1b9fbb5bd16dccd57934157944cea"},
11-
"jason": {:hex, :jason, "1.4.0", "e855647bc964a44e2f67df589ccf49105ae039d4179db7f6271dfd3843dc27e6", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "79a3791085b2a0f743ca04cec0f7be26443738779d09302e01318f97bdb82121"},
12-
"makeup": {:hex, :makeup, "1.1.0", "6b67c8bc2882a6b6a445859952a602afc1a41c2e08379ca057c0f525366fc3ca", [:mix], [{:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "0a45ed501f4a8897f580eabf99a2e5234ea3e75a4373c8a52824f6e873be57a6"},
13-
"makeup_elixir": {:hex, :makeup_elixir, "0.16.1", "cc9e3ca312f1cfeccc572b37a09980287e243648108384b97ff2b76e505c3555", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "e127a341ad1b209bd80f7bd1620a15693a9908ed780c3b763bccf7d200c767c6"},
14-
"makeup_erlang": {:hex, :makeup_erlang, "0.1.2", "ad87296a092a46e03b7e9b0be7631ddcf64c790fa68a9ef5323b6cbb36affc72", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "f3f5a1ca93ce6e092d92b6d9c049bcda58a3b617a8d888f8e7231c85630e8108"},
2+
"castore": {:hex, :castore, "1.0.14", "4582dd7d630b48cf5e1ca8d3d42494db51e406b7ba704e81fbd401866366896a", [:mix], [], "hexpm", "7bc1b65249d31701393edaaac18ec8398d8974d52c647b7904d01b964137b9f4"},
3+
"certifi": {:hex, :certifi, "2.15.0", "0e6e882fcdaaa0a5a9f2b3db55b1394dba07e8d6d9bcad08318fb604c6839712", [:rebar3], [], "hexpm", "b147ed22ce71d72eafdad94f055165c1c182f61a2ff49df28bcc71d1d5b94a60"},
4+
"db_connection": {:hex, :db_connection, "2.7.0", "b99faa9291bb09892c7da373bb82cba59aefa9b36300f6145c5f201c7adf48ec", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "dcf08f31b2701f857dfc787fbad78223d61a32204f217f15e881dd93e4bdd3ff"},
5+
"decimal": {:hex, :decimal, "2.3.0", "3ad6255aa77b4a3c4f818171b12d237500e63525c2fd056699967a3e7ea20f62", [:mix], [], "hexpm", "a4d66355cb29cb47c3cf30e71329e58361cfcb37c34235ef3bf1d7bf3773aeac"},
6+
"earmark_parser": {:hex, :earmark_parser, "1.4.44", "f20830dd6b5c77afe2b063777ddbbff09f9759396500cdbe7523efd58d7a339c", [:mix], [], "hexpm", "4778ac752b4701a5599215f7030989c989ffdc4f6df457c5f36938cc2d2a2750"},
7+
"ex_doc": {:hex, :ex_doc, "0.38.2", "504d25eef296b4dec3b8e33e810bc8b5344d565998cd83914ffe1b8503737c02", [:mix], [{:earmark_parser, "~> 1.4.44", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.0", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14 or ~> 1.0", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1 or ~> 1.0", [hex: :makeup_erlang, repo: "hexpm", optional: false]}, {:makeup_html, ">= 0.1.0", [hex: :makeup_html, repo: "hexpm", optional: true]}], "hexpm", "732f2d972e42c116a70802f9898c51b54916e542cc50968ac6980512ec90f42b"},
8+
"excoding": {:hex, :excoding, "0.1.5", "779aab7fef0dfe57f2b1d41c1820fd66483e2b2a3ccd96805f1656d513910051", [:mix], [{:rustler, ">= 0.0.0", [hex: :rustler, repo: "hexpm", optional: true]}, {:rustler_precompiled, "~> 0.5", [hex: :rustler_precompiled, repo: "hexpm", optional: false]}], "hexpm", "db66ee44caf37528887e380a900dc5e234bd57925fc9d91e8c4b0d1ad1700ae1"},
9+
"hackney": {:hex, :hackney, "1.24.1", "f5205a125bba6ed4587f9db3cc7c729d11316fa8f215d3e57ed1c067a9703fa9", [:rebar3], [{:certifi, "~> 2.15.0", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "~> 6.1.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "~> 1.0.0", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~> 1.4", [hex: :mimerl, repo: "hexpm", optional: false]}, {:parse_trans, "3.4.1", [hex: :parse_trans, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "~> 1.1.0", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}, {:unicode_util_compat, "~> 0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "f4a7392a0b53d8bbc3eb855bdcc919cd677358e65b2afd3840b5b3690c4c8a39"},
10+
"idna": {:hex, :idna, "6.1.1", "8a63070e9f7d0c62eb9d9fcb360a7de382448200fbbd1b106cc96d3d8099df8d", [:rebar3], [{:unicode_util_compat, "~> 0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "92376eb7894412ed19ac475e4a86f7b413c1b9fbb5bd16dccd57934157944cea"},
11+
"jason": {:hex, :jason, "1.4.4", "b9226785a9aa77b6857ca22832cffa5d5011a667207eb2a0ad56adb5db443b8a", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "c5eb0cab91f094599f94d55bc63409236a8ec69a21a67814529e8d5f6cc90b3b"},
12+
"makeup": {:hex, :makeup, "1.2.1", "e90ac1c65589ef354378def3ba19d401e739ee7ee06fb47f94c687016e3713d1", [:mix], [{:nimble_parsec, "~> 1.4", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "d36484867b0bae0fea568d10131197a4c2e47056a6fbe84922bf6ba71c8d17ce"},
13+
"makeup_elixir": {:hex, :makeup_elixir, "1.0.1", "e928a4f984e795e41e3abd27bfc09f51db16ab8ba1aebdba2b3a575437efafc2", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "7284900d412a3e5cfd97fdaed4f5ed389b8f2b4cb49efc0eb3bd10e2febf9507"},
14+
"makeup_erlang": {:hex, :makeup_erlang, "1.0.2", "03e1804074b3aa64d5fad7aa64601ed0fb395337b982d9bcf04029d68d51b6a7", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "af33ff7ef368d5893e4a267933e7744e46ce3cf1f61e2dccf53a111ed3aa3727"},
1515
"metrics": {:hex, :metrics, "1.0.1", "25f094dea2cda98213cecc3aeff09e940299d950904393b2a29d191c346a8486", [:rebar3], [], "hexpm", "69b09adddc4f74a40716ae54d140f93beb0fb8978d8636eaded0c31b6f099f16"},
16-
"mimerl": {:hex, :mimerl, "1.2.0", "67e2d3f571088d5cfd3e550c383094b47159f3eee8ffa08e64106cdf5e981be3", [:rebar3], [], "hexpm", "f278585650aa581986264638ebf698f8bb19df297f66ad91b18910dfc6e19323"},
17-
"nimble_parsec": {:hex, :nimble_parsec, "1.3.1", "2c54013ecf170e249e9291ed0a62e5832f70a476c61da16f6aac6dca0189f2af", [:mix], [], "hexpm", "2682e3c0b2eb58d90c6375fc0cc30bc7be06f365bf72608804fb9cffa5e1b167"},
18-
"parse_trans": {:hex, :parse_trans, "3.3.1", "16328ab840cc09919bd10dab29e431da3af9e9e7e7e6f0089dd5a2d2820011d8", [:rebar3], [], "hexpm", "07cd9577885f56362d414e8c4c4e6bdf10d43a8767abb92d24cbe8b24c54888b"},
19-
"rustler_precompiled": {:hex, :rustler_precompiled, "0.7.1", "ecadf02cc59a0eccbaed6c1937303a5827fbcf60010c541595e6d3747d3d0f9f", [:mix], [{:castore, "~> 0.1 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: false]}, {:rustler, "~> 0.23", [hex: :rustler, repo: "hexpm", optional: true]}], "hexpm", "b9e4657b99a1483ea31502e1d58c464bedebe9028808eda45c3a429af4550c66"},
16+
"mimerl": {:hex, :mimerl, "1.4.0", "3882a5ca67fbbe7117ba8947f27643557adec38fa2307490c4c4207624cb213b", [:rebar3], [], "hexpm", "13af15f9f68c65884ecca3a3891d50a7b57d82152792f3e19d88650aa126b144"},
17+
"nimble_parsec": {:hex, :nimble_parsec, "1.4.2", "8efba0122db06df95bfaa78f791344a89352ba04baedd3849593bfce4d0dc1c6", [:mix], [], "hexpm", "4b21398942dda052b403bbe1da991ccd03a053668d147d53fb8c4e0efe09c973"},
18+
"parse_trans": {:hex, :parse_trans, "3.4.1", "6e6aa8167cb44cc8f39441d05193be6e6f4e7c2946cb2759f015f8c56b76e5ff", [:rebar3], [], "hexpm", "620a406ce75dada827b82e453c19cf06776be266f5a67cff34e1ef2cbb60e49a"},
19+
"rustler_precompiled": {:hex, :rustler_precompiled, "0.8.2", "5f25cbe220a8fac3e7ad62e6f950fcdca5a5a5f8501835d2823e8c74bf4268d5", [:mix], [{:castore, "~> 0.1 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: false]}, {:rustler, "~> 0.23", [hex: :rustler, repo: "hexpm", optional: true]}], "hexpm", "63d1bd5f8e23096d1ff851839923162096364bac8656a4a3c00d1fff8e83ee0a"},
2020
"ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.7", "354c321cf377240c7b8716899e182ce4890c5938111a1296add3ec74cf1715df", [:make, :mix, :rebar3], [], "hexpm", "fe4c190e8f37401d30167c8c405eda19469f34577987c76dde613e838bbc67f8"},
2121
"table": {:hex, :table, "0.1.2", "87ad1125f5b70c5dea0307aa633194083eb5182ec537efc94e96af08937e14a8", [:mix], [], "hexpm", "7e99bc7efef806315c7e65640724bf165c3061cdc5d854060f74468367065029"},
22-
"telemetry": {:hex, :telemetry, "1.2.1", "68fdfe8d8f05a8428483a97d7aab2f268aaff24b49e0f599faa091f1d4e7f61c", [:rebar3], [], "hexpm", "dad9ce9d8effc621708f99eac538ef1cbe05d6a874dd741de2e689c47feafed5"},
23-
"tzdata": {:hex, :tzdata, "1.1.1", "20c8043476dfda8504952d00adac41c6eda23912278add38edc140ae0c5bcc46", [:mix], [{:hackney, "~> 1.17", [hex: :hackney, repo: "hexpm", optional: false]}], "hexpm", "a69cec8352eafcd2e198dea28a34113b60fdc6cb57eb5ad65c10292a6ba89787"},
24-
"unicode_util_compat": {:hex, :unicode_util_compat, "0.7.0", "bc84380c9ab48177092f43ac89e4dfa2c6d62b40b8bd132b1059ecc7232f9a78", [:rebar3], [], "hexpm", "25eee6d67df61960cf6a794239566599b09e17e668d3700247bc498638152521"},
22+
"telemetry": {:hex, :telemetry, "1.3.0", "fedebbae410d715cf8e7062c96a1ef32ec22e764197f70cda73d82778d61e7a2", [:rebar3], [], "hexpm", "7015fc8919dbe63764f4b4b87a95b7c0996bd539e0d499be6ec9d7f3875b79e6"},
23+
"tzdata": {:hex, :tzdata, "1.1.3", "b1cef7bb6de1de90d4ddc25d33892b32830f907e7fc2fccd1e7e22778ab7dfbc", [:mix], [{:hackney, "~> 1.17", [hex: :hackney, repo: "hexpm", optional: false]}], "hexpm", "d4ca85575a064d29d4e94253ee95912edfb165938743dbf002acdf0dcecb0c28"},
24+
"unicode_util_compat": {:hex, :unicode_util_compat, "0.7.1", "a48703a25c170eedadca83b11e88985af08d35f37c6f664d6dcfb106a97782fc", [:rebar3], [], "hexpm", "b3a917854ce3ae233619744ad1e0102e05673136776fb2fa76234f3e03b23642"},
2525
}

test/decimal_test.exs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ defmodule DecimalTest do
55

66
alias Tds.Parameter
77

8-
@tag timeout: 50_000
9-
108
setup do
119
{:ok, pid} = Tds.start_link(opts())
1210

test/rpc_test.exs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ defmodule RPCTest do
55
use ExUnit.Case, async: false
66
alias Tds.Parameter
77

8-
@tag timeout: 50_000
9-
108
setup do
119
{:ok, pid} = Tds.start_link(opts())
1210

test/tds_protocol_test.exs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ defmodule TdsProtocolTest do
33
require Logger
44
use ExUnit.Case, async: true
55

6-
@tag timeout: 50_000
76
@moduletag :capture_log
87

98
setup do

test/test_helper.exs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ defmodule Tds.TestHelper do
8989

9090
def sqlcmd(params, sql, args \\ []) do
9191
args = [
92+
# Trust server certs
93+
"-C",
9294
"-U",
9395
params[:username],
9496
"-P",
@@ -116,8 +118,11 @@ case Tds.TestHelper.sqlcmd(opts, """
116118
END;
117119
CREATE DATABASE [#{database}];
118120
""") do
119-
{"", 0} -> :ok
120-
_ -> raise RuntimeError, "Initalizing database failed. Is the database server running?"
121+
{"", 0} ->
122+
:ok
123+
124+
{err, _} ->
125+
raise RuntimeError, "Failed to create database '#{database}' due #{err}"
121126
end
122127

123128
{"Changed database context to 'test'." <> _, 0} =

test/transaction_test.exs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ defmodule Tds.TransactionTest do
3737
[]
3838
)
3939

40-
assert {:ok, %Tds.Result{columns: [""], num_rows: 1, rows: ['*']}} =
40+
assert {:ok, %Tds.Result{columns: [""], num_rows: 1, rows: [~c"*"]}} =
4141
Tds.query(conn, "SELECT 42", [])
4242

4343
:hi
@@ -60,7 +60,7 @@ defmodule Tds.TransactionTest do
6060
[]
6161
)
6262

63-
assert {:ok, %Tds.Result{columns: [""], num_rows: 1, rows: ['*']}} =
63+
assert {:ok, %Tds.Result{columns: [""], num_rows: 1, rows: [~c"*"]}} =
6464
Tds.query(conn, "SELECT 42", [])
6565

6666
Tds.rollback(conn, :oops)
@@ -95,7 +95,7 @@ defmodule Tds.TransactionTest do
9595

9696
assert DBConnection.status(conn, opts) == :error
9797

98-
assert {:ok, %Tds.Result{columns: [""], num_rows: 1, rows: ['*']}} =
98+
assert {:ok, %Tds.Result{columns: [""], num_rows: 1, rows: [~c"*"]}} =
9999
Tds.query(conn, "SELECT 42", [], opts)
100100

101101
assert DBConnection.status(conn, opts) == :error

0 commit comments

Comments
 (0)