Skip to content

Commit

Permalink
Update dependencies on top of 0.2.0 (#95)
Browse files Browse the repository at this point in the history
* #94: Update dependencies on to of 0.2.1

---------

Co-authored-by: Christoph Pirkl <4711730+kaklakariada@users.noreply.github.com>
Co-authored-by: Nicola Coretti <nico.coretti@gmail.com>
  • Loading branch information
3 people authored Jul 2, 2024
1 parent d432415 commit 9802ea8
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 31 deletions.
4 changes: 3 additions & 1 deletion .busted
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
return {
_all = {
coverage = true,
shuffle = true,
recursive = true,
verbose = true,
Expand All @@ -14,6 +13,7 @@ return {
default = {
},
ci = {
coverage = true,
--output = "junit",
--Xoutput = "target/test-reports/test-report.xml"
},
Expand All @@ -28,9 +28,11 @@ return {
ROOT = {"spec/integration/smoketest_spec.lua"},
},
utest = {
coverage = true,
ROOT = {"spec/unit"},
},
itest = {
coverage = true,
ROOT = {"spec/integration"},
}
}
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ Check out the [user guide](doc/user_guide/user_guide.md) for more details.
## Features

1. Connect to an [Exasol](https://www.exasol.com/) database and execute SQL statements
1. Encrypted communication via TLS
1. Compatible with the [LuaSQL](https://github.com/lunarmodules/luasql) API
1. Runs inside an Exasol [user defined functions (UDF)](https://docs.exasol.com/db/latest/database_concepts/udf_scripts.htm), see the [user guide](./doc/user_guide/user_guide.md#using-exasol-driver-lua-in-an-exasol-udf) for details. Exasol 8 or later is required for this.
2. Encrypted communication via TLS
3. Compatible with the [LuaSQL](https://github.com/lunarmodules/luasql) API
4. Runs inside an Exasol [user defined functions (UDF)](https://docs.exasol.com/db/latest/database_concepts/udf_scripts.htm), see the [user guide](./doc/user_guide/user_guide.md#using-exasol-driver-lua-in-an-exasol-udf) for details. Exasol 8 or later is required for this.

## Information for Users

Expand Down
12 changes: 10 additions & 2 deletions doc/changes/changes_0.2.1.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
# exasol-driver-lua 0.2.1, released 2023-06-??
# exasol-driver-lua 0.2.1, released 2024-07-??

Code name: Upgrade to Exasol 8

## Summary

This release updates integration tests to additionally use Exasol version 8.18.1.
This release updates integration tests to additionally use Exasol version 8.23.0.

When running integration tests with `luarocks test` or `busted`, the environment variable `EXASOL_HOST` now has a default value `localhost` to make running tests more convenient.
If you run local tests, the Exasol DB is most likely set up to forward the default database port to the localhost anyway.

Additionally, coverage checks are now restricted to selected busted configurations. For example, it does not make sense to run with coverage on repeated tests.

Integration test now succeeds with TLS 1.3 in addition to TLS 1.2 (version 8.18.0)

## Tests

* #56: Sped up repeated CI tests
* #78: Added tests with Exasol 8
2 changes: 1 addition & 1 deletion doc/developer_guide/developer_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ You need an Exasol database for running the tests. You can start a Docker instan
To start Exasol in a Docker container, run the following:

```sh
docker run --publish 8563:8563 --detach --privileged --stop-timeout 120 exasol/docker-db:8.26.0
docker run --publish 8563:8563 --detach --privileged --stop-timeout 120 exasol/docker-db:8.27.0
```

Once Exasol is running, start the tests by executing:
Expand Down
4 changes: 2 additions & 2 deletions luasql-exasol-0.2.1-1.rockspec
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ dependencies = {
"luasocket >= 3.1.0-1",
"luasec >= 1.3.2-1",
"luaossl >= 20220711-0",
"lua-cjson == 2.1.0", -- pinned to prevent "undefined symbol: lua_objlen" in 2.1.0.6 (https://github.com/mpx/lua-cjson/issues/56)
"lua-cjson == 2.1.0.10-1",
"base64 >= 1.5-3",
"exaerror >= 2.0.3-1",
"remotelog >= 1.1.1-1"
Expand All @@ -42,7 +42,7 @@ test_dependencies = {
"mockagne >= 1.0-2",
"luacov >= 0.15.0-1",
"luacov-coveralls >= 0.2.3-1",
"luacheck >= 1.1.2-1",
"luacheck >= 1.2.0-1",
"ldoc >= 1.5.0-1",
"amalg >= 0.8-1",
"luasql-sqlite3 >= 2.6.1-3"
Expand Down
18 changes: 5 additions & 13 deletions spec/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,16 @@ local function get_optional_system_env(varname, default)
return value
end

local function get_system_env(varname, default)
local value = get_optional_system_env(varname, default)
if value == nil and default == nil then
error("Environment variable '" .. varname .. "' required for test is not defined")
end
return value
end

function M.get_connection_params(override)
override = override or {}
local host = override.host or get_system_env("EXASOL_HOST")
local port = override.port or get_system_env("EXASOL_PORT", "8563")
local host = override.host or get_optional_system_env("EXASOL_HOST", "localhost")
local port = override.port or get_optional_system_env("EXASOL_PORT", "8563")
return {
host = host,
port = port,
source_name = string.format("%s:%s", host, port),
user = override.user or get_system_env("EXASOL_USER", "sys"),
password = override.password or get_system_env("EXASOL_PASSWORD", "exasol"),
user = override.user or get_optional_system_env("EXASOL_USER", "sys"),
password = override.password or get_optional_system_env("EXASOL_PASSWORD", "exasol"),
fingerprint = override.fingerprint or nil
}
end
Expand All @@ -49,7 +41,7 @@ function M.configure_logging()
if luws_trace == "TRACE" then
enable_luws_trace_log()
end
local log_level = string.upper(get_system_env("LOG_LEVEL", "INFO"))
local log_level = string.upper(get_optional_system_env("LOG_LEVEL", "INFO"))
log.set_level(log_level)
end

Expand Down
14 changes: 7 additions & 7 deletions spec/integration/Websocket_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ local function get_ssl_socket_creation_error(error_details)
return get_connection_error(string.format("Failed to create SSL socket: '%s'", error_details))
end

local ssl_negotion_failed_error<const> = get_connection_error("Failed SSL negotation")
local ssl_negotiation_failed_error<const> = get_connection_error("Failed SSL/TLS negotiation")

local function connect(properties, url)
url = url or local_websocket_url
Expand Down Expand Up @@ -55,7 +55,7 @@ describe("Websocket", function()
describe("fails SSL negotiation for valid value", function()
for _, tls_verify_option in ipairs({"peer", "client_once", "fail_if_no_peer_cert"}) do
it(string.format("%q", tls_verify_option), function()
assert_connect_fails({tls_verify = tls_verify_option}, ssl_negotion_failed_error)
assert_connect_fails({tls_verify = tls_verify_option}, ssl_negotiation_failed_error)
end)
end
end)
Expand All @@ -71,7 +71,7 @@ describe("Websocket", function()
end)

describe("with tls_protocol option", function()
describe("connects successfully for value", function()
describe("connects successfully for Exasol-supported protocol version:", function()
local supported_protocols = {"any", "tlsv1_2"}
if config.db_supports_tlsv1_3() then
table.insert(supported_protocols, "tlsv1_3")
Expand All @@ -83,14 +83,14 @@ describe("Websocket", function()
end
end)

describe("fails SSL negotiation for valid value", function()
describe("fails SSL negotiation for TLS protocol version that is not supported by Exasol:", function()
local unsupported_protocols = {"tlsv1", "tlsv1_1"}
if not config.db_supports_tlsv1_3() then
table.insert(unsupported_protocols, "tlsv1_3")
end
for _, tls_protocol_option in ipairs(unsupported_protocols) do
it(string.format("%q", tls_protocol_option), function()
assert_connect_fails({tls_protocol = tls_protocol_option}, ssl_negotion_failed_error)
assert_connect_fails({tls_protocol = tls_protocol_option}, ssl_negotiation_failed_error)
end)
end
end)
Expand All @@ -106,7 +106,7 @@ describe("Websocket", function()
end)

describe("with tls_options", function()
describe("connects successfully for value", function()
describe("connects successfully for Exasol-supported protocol version:", function()
for _, tls_options in ipairs({
"", "all", "no_tlsv1_1", "no_tlsv1_3", "no_tlsv1", "no_tlsv1_1,no_tlsv1_3,no_tlsv1"
}) do
Expand All @@ -119,7 +119,7 @@ describe("Websocket", function()
describe("fails SSL negotiation for valid value", function()
for _, tls_options in ipairs({"no_tlsv1_2", "no_tlsv1_2,all", "no_tlsv1_2,all"}) do
it(string.format("%q", tls_options), function()
assert_connect_fails({tls_options = tls_options}, ssl_negotion_failed_error)
assert_connect_fails({tls_options = tls_options}, ssl_negotiation_failed_error)
end)
end
end)
Expand Down
4 changes: 2 additions & 2 deletions src/luasql/exasol/luws.lua
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,10 @@ function wsopen( url, handler, options )
D("wsopen() successful SSL/TLS negotiation")
wsconn.socket = sock -- save wrapped socket
else
D("wsopen() failed SSL negotation")
D("wsopen() failed SSL/TLS negotiation")
wsconn.socket:close()
wsconn.socket = nil
return false, "Failed SSL negotation"
return false, "Failed SSL/TLS negotiation"
end
end
D("wsopen() upgrading connection to WebSocket")
Expand Down

0 comments on commit 9802ea8

Please sign in to comment.