Business intelligence made simple
Test MySQL cohorts [skip ci]
Andrew Kaned852e8bf910b
diff --git a/Gemfile b/Gemfileindex 57b8adee..d9be9cec 100644--- a/Gemfile+++ b/Gemfile@@ -11,6 +11,7 @@ gem "sprockets-rails"# data sourcesgem "elasticsearch"+gem "mysql2"# anomaly detection and forecastinggem "prophet-rb" if ENV["TEST_PROPHET"]diff --git a/test/charts_test.rb b/test/charts_test.rbindex ed253f7e..afab6f83 100644--- a/test/charts_test.rb+++ b/test/charts_test.rb@@ -46,9 +46,4 @@ class ChartsTest < ActionDispatch::IntegrationTestrun_query "SELECT NOW(), 1, 2 AS target"assert_match %{"name":"target"}, response.bodyend-- def test_cohort_analysis- run_query "SELECT 1 AS user_id, NOW() AS conversion_time /* cohort analysis */", query_id: 1- assert_match "1 cohort", response.body- endenddiff --git a/test/cohort_analysis_test.rb b/test/cohort_analysis_test.rbnew file mode 100644index 00000000..523b04d7--- /dev/null+++ b/test/cohort_analysis_test.rb@@ -0,0 +1,15 @@+require_relative "test_helper"++class CohortAnalysisTest < ActionDispatch::IntegrationTest+ def test_postgres+ run_query "SELECT 1 AS user_id, NOW() AS conversion_time /* cohort analysis */", query_id: 1+ assert_match "1 cohort", response.body+ end++ def test_mysql+ skip unless ENV["TEST_MYSQL"]++ run_query "SELECT 1 AS user_id, NOW() AS conversion_time /* cohort analysis */", query_id: 1, data_source: "mysql"+ assert_match "1 cohort", response.body+ end+enddiff --git a/test/internal/config/blazer.yml b/test/internal/config/blazer.ymlindex bdd476b4..475a600d 100644--- a/test/internal/config/blazer.yml+++ b/test/internal/config/blazer.yml@@ -36,6 +36,9 @@ data_sources:adapter: elasticsearchurl: http://localhost:9200+ mysql:+ url: mysql2://localhost:3306/blazer_test+# create auditsaudit: true