Skip to content

Business intelligence made simple

Started adapter tests

Andrew Kane2615e7bcf1ca
diff --git a/Gemfile b/Gemfile
index a73155cf..adfb9347 100644
--- a/Gemfile
+++ b/Gemfile
@@ -9,3 +9,6 @@ gem "rails"
gem "pg"
gem "sprockets-rails"
gem "prophet-rb" if ENV["TEST_FORECASTING"]
+
+# data sources
+gem "elasticsearch"
diff --git a/Rakefile b/Rakefile
index 5cda719c..21f1938e 100644
--- a/Rakefile
+++ b/Rakefile
@@ -4,5 +4,5 @@ require "rake/testtask"
task default: :test
Rake::TestTask.new do |t|
t.libs << "test"
- t.pattern = "test/**/*_test.rb"
+ t.pattern = "test/*_test.rb"
end
diff --git a/test/adapters/elasticsearch_test.rb b/test/adapters/elasticsearch_test.rb
new file mode 100644
index 00000000..85b9349a
--- /dev/null
+++ b/test/adapters/elasticsearch_test.rb
@@ -0,0 +1,13 @@
+require_relative "../test_helper"
+
+class ElasticsearchTest < ActionDispatch::IntegrationTest
+ def test_run
+ run_query "SELECT 1", data_source: "elasticsearch"
+ end
+
+ def test_tables
+ get blazer.tables_queries_path(data_source: "elasticsearch")
+ assert_response :success
+ assert_kind_of Array, JSON.parse(response.body)
+ end
+end
diff --git a/test/internal/config/blazer.yml b/test/internal/config/blazer.yml
index 4406305c..d552dbc8 100644
--- a/test/internal/config/blazer.yml
+++ b/test/internal/config/blazer.yml
@@ -32,6 +32,10 @@ data_sources:
smart_columns:
# user_id: "SELECT id, name FROM users WHERE id IN {value}"
+ elasticsearch:
+ adapter: elasticsearch
+ url: http://localhost:9200
+
# create audits
audit: true