aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2018-10-01 20:21:26 +0100
committerMatthew Wild <mwild1@gmail.com>2018-10-01 20:21:26 +0100
commite400842d43df5a18b7aea5acd3e724e97a308c9f (patch)
tree49d7e2a1d577abf26a129689c87d859bcf2368e7
parentaadbe03b3d5c0c26321035290711308e8b5ad7b4 (diff)
downloadprosody-e400842d43df5a18b7aea5acd3e724e97a308c9f.tar.gz
prosody-e400842d43df5a18b7aea5acd3e724e97a308c9f.zip
Fix storage tests so they run, but not by default
-rw-r--r--.busted9
-rw-r--r--spec/core_storagemanager_spec.lua (renamed from spec/core_storagemanager.lua)15
2 files changed, 17 insertions, 7 deletions
diff --git a/.busted b/.busted
index 8e444f9c..f5f9472e 100644
--- a/.busted
+++ b/.busted
@@ -2,9 +2,12 @@ return {
_all = {
},
default = {
- ["exclude-tags"] = "mod_bosh";
- },
+ ["exclude-tags"] = "mod_bosh,storage";
+ };
bosh = {
tags = "mod_bosh";
- }
+ };
+ storage = {
+ tags = "storage";
+ };
}
diff --git a/spec/core_storagemanager.lua b/spec/core_storagemanager_spec.lua
index 29a924ac..ad4150d3 100644
--- a/spec/core_storagemanager.lua
+++ b/spec/core_storagemanager_spec.lua
@@ -20,15 +20,23 @@ local configs = {
storage = "sql";
sql = { driver = "SQLite3", database = "prosody-tests.sqlite" };
};
+ mysql = {
+ storage = "sql";
+ sql = { driver = "MySQL", database = "prosody", username = "prosody", password = "secret", host = "localhost" };
+ };
+ postgres = {
+ storage = "sql";
+ sql = { driver = "PostgreSQL", database = "prosody", username = "prosody", password = "secret", host = "localhost" };
+ };
};
local test_host = "storage-unit-tests.invalid";
describe("storagemanager", function ()
- for _, backend in ipairs({ "internal", "sqlite" }) do
+ for backend, backend_config in pairs(configs) do
local tagged_name = "#"..backend;
- if backend ~= configs[backend].storage then
- tagged_name = tagged_name.." #"..configs[backend].storage;
+ if backend ~= backend_config.storage then
+ tagged_name = tagged_name.." #"..backend_config.storage;
end
insulate(tagged_name.." #storage backend", function ()
mock_prosody();
@@ -41,7 +49,6 @@ describe("storagemanager", function ()
-- Simple check to ensure insulation is working correctly
assert.is_nil(config.get(test_host, "storage"));
- local backend_config = configs[backend];
for k, v in pairs(backend_config) do
config.set(test_host, k, v);
end