Skip to content

Business intelligence made simple

Moved adapter config for tests

Andrew Kaneb6821d358ef9
diff --git a/test/internal/config/blazer.yml b/test/internal/config/blazer.yml
index 1639b23c..11ab6b39 100644
--- a/test/internal/config/blazer.yml
+++ b/test/internal/config/blazer.yml
@@ -36,86 +36,6 @@ data_sources:
variable_defaults:
default_var: default_value
- athena:
- adapter: athena
- database: blazer_test
-
- bigquery:
- adapter: bigquery
- project: your-project
- keyfile: path/to/keyfile.json
-
- cassandra:
- url: cassandra://localhost:9042/blazer_test
-
- drill:
- adapter: drill
- url: http://localhost:8047
-
- druid:
- adapter: druid
- url: http://localhost:8082
-
- elasticsearch:
- adapter: elasticsearch
- url: http://localhost:9200
-
- hive:
- adapter: hive
- url: sasl://localhost:10000/blazer_test
-
- ignite:
- url: ignite://localhost:10800
-
- influxdb:
- adapter: influxdb
- url: http://localhost:8086/blazer_test
-
- mongodb:
- url: mongodb://localhost:27017/blazer_test
-
- mysql:
- url: mysql2://localhost:3306/blazer_test # ?prepared_statements=true
-
- neo4j:
- adapter: neo4j
- url: http://neo4j:secret@localhost:7474/blazer_test
-
- opensearch:
- adapter: opensearch
- url: http://localhost:9200
-
- postgresql:
- url: postgres://localhost/blazer_test
-
- presto:
- url: presto://user@localhost:8080/jmx
-
- redshift:
- url: redshift://localhost:5439/blazer_test
-
- salesforce:
- adapter: salesforce
-
- soda:
- adapter: soda
- # url: https://...
- # app_token: ...
-
- spark:
- adapter: spark
- url: sasl://localhost:10000/blazer_test
-
- snowflake:
- adapter: snowflake
- # conn_str: ...
-
- sqlite:
- url: "sqlite3::memory:"
-
- sqlserver:
- url: sqlserver://SA:YourStrong!Passw0rd@localhost:1433/blazer_test
-
# create audits
audit: true
diff --git a/test/permissions_test.rb b/test/permissions_test.rb
index e295a4c8..59b7389a 100644
--- a/test/permissions_test.rb
+++ b/test/permissions_test.rb
@@ -28,11 +28,9 @@ class PermissionsTest < ActionDispatch::IntegrationTest
end
with_new_user do
- Blazer.stub(:data_sources, Blazer.data_sources.slice("main")) do
- patch blazer.query_path(query), params: {name: "Renamed"}
- assert_response :unprocessable_entity
- assert_match "Sorry, permission denied", response.body
- end
+ patch blazer.query_path(query), params: {name: "Renamed"}
+ assert_response :unprocessable_entity
+ assert_match "Sorry, permission denied", response.body
delete blazer.query_path(query)
# TODO error response
diff --git a/test/support/adapter_test.rb b/test/support/adapter_test.rb
index c59a82f4..48bad8cc 100644
--- a/test/support/adapter_test.rb
+++ b/test/support/adapter_test.rb
@@ -1,4 +1,9 @@
module AdapterTest
+ def setup
+ settings = YAML.load_file("test/support/adapters.yml")
+ Blazer.instance_variable_set(:@settings, settings)
+ end
+
# some adapter tests override this method
def test_tables
assert_kind_of Array, tables
diff --git a/test/support/adapters.yml b/test/support/adapters.yml
new file mode 100644
index 00000000..faac0f9e
--- /dev/null
+++ b/test/support/adapters.yml
@@ -0,0 +1,80 @@
+data_sources:
+ athena:
+ adapter: athena
+ database: blazer_test
+
+ bigquery:
+ adapter: bigquery
+ project: your-project
+ keyfile: path/to/keyfile.json
+
+ cassandra:
+ url: cassandra://localhost:9042/blazer_test
+
+ drill:
+ adapter: drill
+ url: http://localhost:8047
+
+ druid:
+ adapter: druid
+ url: http://localhost:8082
+
+ elasticsearch:
+ adapter: elasticsearch
+ url: http://localhost:9200
+
+ hive:
+ adapter: hive
+ url: sasl://localhost:10000/blazer_test
+
+ ignite:
+ url: ignite://localhost:10800
+
+ influxdb:
+ adapter: influxdb
+ url: http://localhost:8086/blazer_test
+
+ mongodb:
+ url: mongodb://localhost:27017/blazer_test
+
+ mysql:
+ url: mysql2://localhost:3306/blazer_test # ?prepared_statements=true
+
+ neo4j:
+ adapter: neo4j
+ url: http://neo4j:secret@localhost:7474/blazer_test
+
+ opensearch:
+ adapter: opensearch
+ url: http://localhost:9200
+
+ postgresql:
+ url: postgres://localhost/blazer_test
+
+ presto:
+ url: presto://user@localhost:8080/jmx
+
+ redshift:
+ url: redshift://localhost:5439/blazer_test
+
+ salesforce:
+ adapter: salesforce
+
+ soda:
+ adapter: soda
+ # url: https://...
+ # app_token: ...
+
+ spark:
+ adapter: spark
+ url: sasl://localhost:10000/blazer_test
+
+ snowflake:
+ adapter: snowflake
+ # conn_str: ...
+
+ sqlite:
+ url: "sqlite3::memory:"
+
+ sqlserver:
+ url: sqlserver://SA:YourStrong!Passw0rd@localhost:1433/blazer_test