Skip to content

Business intelligence made simple

Improved InfluxDB test [skip ci]

Andrew Kanea79fd4c98454
diff --git a/test/adapters/influxdb_test.rb b/test/adapters/influxdb_test.rb
index 3675a2e0..d620e0dd 100644
--- a/test/adapters/influxdb_test.rb
+++ b/test/adapters/influxdb_test.rb
@@ -1,9 +1,5 @@
require_relative "../test_helper"
-# USE blazer_test
-# DROP SERIES FROM items
-# INSERT items,hello=world value=1
-
class InfluxdbTest < ActionDispatch::IntegrationTest
include AdapterTest
@@ -11,6 +7,15 @@ class InfluxdbTest < ActionDispatch::IntegrationTest
"influxdb"
end
+ def setup
+ @@once ||= begin
+ client = InfluxDB::Client.new(url: "http://localhost:8086/blazer_test")
+ client.delete_series("items")
+ client.write_point("items", {values: {value: 1}, tags: {hello: "world"}, timestamp: 0})
+ true
+ end
+ end
+
def test_run
expected = [{"time" => "1970-01-01 00:00:00 UTC", "count_value" => "1"}]
assert_result expected, "SELECT COUNT(*) FROM items WHERE hello = 'world'"