mirror of
https://github.com/timescale/timescaledb.git
synced 2025-05-18 03:23:37 +08:00
Fix telemetry test
The current telemetry test fails in ApacheOnly mode because it uses community functions. The PR separates out the community from the apache only testing and add a telemetry_community test that only runs if not in ApacheOnly mode. Also adjust the travis file to print telemetry output for the telemetry test run without openssl.
This commit is contained in:
parent
5917938569
commit
dd24706841
@ -40,7 +40,7 @@ script:
|
||||
|
||||
- ${RETRY_PREFIX} docker exec -u postgres -it pgbuild /bin/sh -c "make -C /build/debug pginstallcheck PG_REGRESS_OPTS='--temp-instance=/tmp/pgdata'"
|
||||
after_failure:
|
||||
- docker exec -u postgres -it pgbuild cat /build/debug/test/regression.diffs /build/debug/tsl/test/regression.diffs /build/debug/test/isolation/regression.diffs /build/debug/tsl/test/isolation/regression.diffs /build/debug/test/pgtest/regression.diffs
|
||||
- docker exec -u postgres -it pgbuild cat /build/debug/test/regression.diffs /build/debug-nossl/test/regression.diffs /build/debug/tsl/test/regression.diffs /build/debug/test/isolation/regression.diffs /build/debug/tsl/test/isolation/regression.diffs /build/debug/test/pgtest/regression.diffs
|
||||
after_success:
|
||||
- ci_env=`bash <(curl -s https://codecov.io/env)`
|
||||
- docker exec -it $ci_env pgbuild /bin/bash -c "cd /build/debug && bash <(curl -s https://codecov.io/bash) || echo \"Codecov did not collect coverage reports\" "
|
||||
|
@ -312,12 +312,6 @@ WHERE key != 'os_name_pretty';
|
||||
num_drop_chunks_policies
|
||||
(22 rows)
|
||||
|
||||
SELECT json_object_field(get_telemetry_report()::json,'num_continuous_aggs');
|
||||
json_object_field
|
||||
-------------------
|
||||
"0"
|
||||
(1 row)
|
||||
|
||||
-- check telemetry picks up flagged content from metadata
|
||||
SELECT json_object_field(get_telemetry_report()::json,'db_metadata');
|
||||
json_object_field
|
||||
@ -332,7 +326,18 @@ SELECT json_object_field(get_telemetry_report()::json,'instance_metadata');
|
||||
{"cloud": "ci"}
|
||||
(1 row)
|
||||
|
||||
--create a continuous agg
|
||||
SELECT json_object_field(get_telemetry_report()::json,'num_hypertables');
|
||||
json_object_field
|
||||
-------------------
|
||||
"0"
|
||||
(1 row)
|
||||
|
||||
SELECT json_object_field(get_telemetry_report()::json,'num_continuous_aggs');
|
||||
json_object_field
|
||||
-------------------
|
||||
"0"
|
||||
(1 row)
|
||||
|
||||
CREATE TABLE device_readings (
|
||||
observation_time TIMESTAMPTZ NOT NULL
|
||||
);
|
||||
@ -342,23 +347,9 @@ SELECT table_name FROM create_hypertable('device_readings', 'observation_time');
|
||||
device_readings
|
||||
(1 row)
|
||||
|
||||
CREATE VIEW device_summary
|
||||
WITH (timescaledb.continuous) AS
|
||||
SELECT
|
||||
time_bucket('1 hour', observation_time) as bucket,
|
||||
min(observation_time)
|
||||
FROM
|
||||
device_readings
|
||||
GROUP BY bucket;
|
||||
SELECT json_object_field(get_telemetry_report()::json,'num_continuous_aggs');
|
||||
SELECT json_object_field(get_telemetry_report()::json,'num_hypertables');
|
||||
json_object_field
|
||||
-------------------
|
||||
"1"
|
||||
(1 row)
|
||||
|
||||
SELECT json_object_field(get_telemetry_report()::json,'num_hypertables');
|
||||
json_object_field
|
||||
-------------------
|
||||
"2"
|
||||
(1 row)
|
||||
|
||||
|
57
test/expected/telemetry_community.out
Normal file
57
test/expected/telemetry_community.out
Normal file
@ -0,0 +1,57 @@
|
||||
--telemetry tests that require a community license
|
||||
SELECT json_object_field(get_telemetry_report()::json,'num_continuous_aggs');
|
||||
json_object_field
|
||||
-------------------
|
||||
"0"
|
||||
(1 row)
|
||||
|
||||
SELECT json_object_field(get_telemetry_report()::json,'num_hypertables');
|
||||
json_object_field
|
||||
-------------------
|
||||
"0"
|
||||
(1 row)
|
||||
|
||||
-- check telemetry picks up flagged content from metadata
|
||||
SELECT json_object_field(get_telemetry_report()::json,'db_metadata');
|
||||
json_object_field
|
||||
-------------------
|
||||
{}
|
||||
(1 row)
|
||||
|
||||
-- check timescaledb_telemetry.cloud
|
||||
SELECT json_object_field(get_telemetry_report()::json,'instance_metadata');
|
||||
json_object_field
|
||||
-------------------
|
||||
{"cloud": "ci"}
|
||||
(1 row)
|
||||
|
||||
--create a continuous agg
|
||||
CREATE TABLE device_readings (
|
||||
observation_time TIMESTAMPTZ NOT NULL
|
||||
);
|
||||
SELECT table_name FROM create_hypertable('device_readings', 'observation_time');
|
||||
table_name
|
||||
-----------------
|
||||
device_readings
|
||||
(1 row)
|
||||
|
||||
CREATE VIEW device_summary
|
||||
WITH (timescaledb.continuous) AS
|
||||
SELECT
|
||||
time_bucket('1 hour', observation_time) as bucket,
|
||||
min(observation_time)
|
||||
FROM
|
||||
device_readings
|
||||
GROUP BY bucket;
|
||||
SELECT json_object_field(get_telemetry_report()::json,'num_continuous_aggs');
|
||||
json_object_field
|
||||
-------------------
|
||||
"1"
|
||||
(1 row)
|
||||
|
||||
SELECT json_object_field(get_telemetry_report()::json,'num_hypertables');
|
||||
json_object_field
|
||||
-------------------
|
||||
"2"
|
||||
(1 row)
|
||||
|
@ -55,7 +55,9 @@ set(TEST_FILES
|
||||
# edition tests need community edition
|
||||
if(NOT APACHE_ONLY)
|
||||
list(APPEND TEST_FILES
|
||||
edition.sql)
|
||||
edition.sql
|
||||
telemetry_community.sql
|
||||
)
|
||||
endif()
|
||||
|
||||
# tests that fail or are unreliable when run in parallel
|
||||
|
@ -127,28 +127,19 @@ SET timescaledb.telemetry_level=off;
|
||||
SELECT * FROM json_object_keys(get_telemetry_report()::json) AS key
|
||||
WHERE key != 'os_name_pretty';
|
||||
|
||||
SELECT json_object_field(get_telemetry_report()::json,'num_continuous_aggs');
|
||||
|
||||
-- check telemetry picks up flagged content from metadata
|
||||
SELECT json_object_field(get_telemetry_report()::json,'db_metadata');
|
||||
|
||||
-- check timescaledb_telemetry.cloud
|
||||
SELECT json_object_field(get_telemetry_report()::json,'instance_metadata');
|
||||
|
||||
SELECT json_object_field(get_telemetry_report()::json,'num_hypertables');
|
||||
|
||||
SELECT json_object_field(get_telemetry_report()::json,'num_continuous_aggs');
|
||||
|
||||
--create a continuous agg
|
||||
CREATE TABLE device_readings (
|
||||
observation_time TIMESTAMPTZ NOT NULL
|
||||
);
|
||||
SELECT table_name FROM create_hypertable('device_readings', 'observation_time');
|
||||
CREATE VIEW device_summary
|
||||
WITH (timescaledb.continuous) AS
|
||||
SELECT
|
||||
time_bucket('1 hour', observation_time) as bucket,
|
||||
min(observation_time)
|
||||
FROM
|
||||
device_readings
|
||||
GROUP BY bucket;
|
||||
|
||||
SELECT json_object_field(get_telemetry_report()::json,'num_continuous_aggs');
|
||||
SELECT json_object_field(get_telemetry_report()::json,'num_hypertables');
|
||||
|
28
test/sql/telemetry_community.sql
Normal file
28
test/sql/telemetry_community.sql
Normal file
@ -0,0 +1,28 @@
|
||||
--telemetry tests that require a community license
|
||||
|
||||
SELECT json_object_field(get_telemetry_report()::json,'num_continuous_aggs');
|
||||
SELECT json_object_field(get_telemetry_report()::json,'num_hypertables');
|
||||
|
||||
-- check telemetry picks up flagged content from metadata
|
||||
SELECT json_object_field(get_telemetry_report()::json,'db_metadata');
|
||||
|
||||
-- check timescaledb_telemetry.cloud
|
||||
SELECT json_object_field(get_telemetry_report()::json,'instance_metadata');
|
||||
|
||||
|
||||
--create a continuous agg
|
||||
CREATE TABLE device_readings (
|
||||
observation_time TIMESTAMPTZ NOT NULL
|
||||
);
|
||||
SELECT table_name FROM create_hypertable('device_readings', 'observation_time');
|
||||
CREATE VIEW device_summary
|
||||
WITH (timescaledb.continuous) AS
|
||||
SELECT
|
||||
time_bucket('1 hour', observation_time) as bucket,
|
||||
min(observation_time)
|
||||
FROM
|
||||
device_readings
|
||||
GROUP BY bucket;
|
||||
|
||||
SELECT json_object_field(get_telemetry_report()::json,'num_continuous_aggs');
|
||||
SELECT json_object_field(get_telemetry_report()::json,'num_hypertables');
|
Loading…
x
Reference in New Issue
Block a user