[tor-commits] [metrics-web/master] Make old tests run (still failing).
karsten at torproject.org
karsten at torproject.org
Fri Dec 22 19:41:07 UTC 2017
commit 2207847531c80e35d8e126617813e999aee143c0
Author: iwakeh <iwakeh at torproject.org>
Date: Wed Dec 20 13:06:58 2017 +0000
Make old tests run (still failing).
This test still needs to be adapted to not fail, cf. TODOs.
Changed some types to lowercase, pgTAP seems to also test case on types.
---
src/test/sql/userstats/test-userstats.sql | 198 +++++++++++++++---------------
1 file changed, 99 insertions(+), 99 deletions(-)
diff --git a/src/test/sql/userstats/test-userstats.sql b/src/test/sql/userstats/test-userstats.sql
index a08cc7d..299f4ab 100644
--- a/src/test/sql/userstats/test-userstats.sql
+++ b/src/test/sql/userstats/test-userstats.sql
@@ -20,7 +20,7 @@ SELECT enum_has_labels('metric', ARRAY['responses', 'bytes', 'status']);
-- it.
SELECT has_table('imported');
SELECT has_column('imported', 'fingerprint');
-SELECT col_type_is('imported', 'fingerprint', 'CHARACTER(40)');
+SELECT col_type_is('imported', 'fingerprint', 'character(40)');
SELECT col_not_null('imported', 'fingerprint');
SELECT has_column('imported', 'node');
SELECT col_type_is('imported', 'node', 'node');
@@ -29,24 +29,24 @@ SELECT has_column('imported', 'metric');
SELECT col_type_is('imported', 'metric', 'metric');
SELECT col_not_null('imported', 'metric');
SELECT has_column('imported', 'country');
-SELECT col_type_is('imported', 'country', 'CHARACTER VARYING(2)');
+SELECT col_type_is('imported', 'country', 'character varying(2)');
SELECT col_not_null('imported', 'country');
SELECT has_column('imported', 'transport');
-SELECT col_type_is('imported', 'transport', 'CHARACTER VARYING(20)');
+SELECT col_type_is('imported', 'transport', 'character varying(20)');
SELECT col_not_null('imported', 'transport');
SELECT has_column('imported', 'version');
-SELECT col_type_is('imported', 'version', 'CHARACTER VARYING(2)');
+SELECT col_type_is('imported', 'version', 'character varying(2)');
SELECT col_not_null('imported', 'version');
SELECT has_column('imported', 'stats_start');
SELECT col_type_is('imported', 'stats_start',
- 'TIMESTAMP WITHOUT TIME ZONE');
+ 'timestamp without time zone');
SELECT col_not_null('imported', 'stats_start');
SELECT has_column('imported', 'stats_end');
SELECT col_type_is('imported', 'stats_end',
- 'TIMESTAMP WITHOUT TIME ZONE');
+ 'timestamp without time zone');
SELECT col_not_null('imported', 'stats_end');
SELECT has_column('imported', 'val');
-SELECT col_type_is('imported', 'val', 'DOUBLE PRECISION');
+SELECT col_type_is('imported', 'val', 'double precision');
SELECT col_not_null('imported', 'val');
SELECT hasnt_pk('imported');
@@ -54,10 +54,10 @@ SELECT hasnt_pk('imported');
-- expects it.
SELECT has_table('merged');
SELECT has_column('merged', 'id');
-SELECT col_type_is('merged', 'id', 'INTEGER');
+SELECT col_type_is('merged', 'id', 'integer');
SELECT col_is_pk('merged', 'id');
SELECT has_column('merged', 'fingerprint');
-SELECT col_type_is('merged', 'fingerprint', 'CHARACTER(40)');
+SELECT col_type_is('merged', 'fingerprint', 'character(40)');
SELECT col_not_null('merged', 'fingerprint');
SELECT has_column('merged', 'node');
SELECT col_type_is('merged', 'node', 'node');
@@ -66,73 +66,73 @@ SELECT has_column('merged', 'metric');
SELECT col_type_is('merged', 'metric', 'metric');
SELECT col_not_null('merged', 'metric');
SELECT has_column('merged', 'country');
-SELECT col_type_is('merged', 'country', 'CHARACTER VARYING(2)');
+SELECT col_type_is('merged', 'country', 'character varying(2)');
SELECT col_not_null('merged', 'country');
SELECT has_column('merged', 'transport');
-SELECT col_type_is('merged', 'transport', 'CHARACTER VARYING(20)');
+SELECT col_type_is('merged', 'transport', 'character varying(20)');
SELECT col_not_null('merged', 'transport');
SELECT has_column('merged', 'version');
-SELECT col_type_is('merged', 'version', 'CHARACTER VARYING(2)');
+SELECT col_type_is('merged', 'version', 'character varying(2)');
SELECT col_not_null('merged', 'version');
SELECT has_column('merged', 'stats_start');
SELECT col_type_is('merged', 'stats_start',
- 'TIMESTAMP WITHOUT TIME ZONE');
+ 'timestamp without time zone');
SELECT col_not_null('merged', 'stats_start');
SELECT has_column('merged', 'stats_end');
SELECT col_type_is('merged', 'stats_end',
- 'TIMESTAMP WITHOUT TIME ZONE');
+ 'timestamp without time zone');
SELECT col_not_null('merged', 'stats_end');
SELECT has_column('merged', 'val');
-SELECT col_type_is('merged', 'val', 'DOUBLE PRECISION');
+SELECT col_type_is('merged', 'val', 'double precision');
SELECT col_not_null('merged', 'val');
-- Make sure that the internally-used aggregated table is exactly as
-- aggregate() expects it.
SELECT has_table('aggregated');
SELECT has_column('aggregated', 'date');
-SELECT col_type_is('aggregated', 'date', 'DATE');
+SELECT col_type_is('aggregated', 'date', 'date');
SELECT col_not_null('aggregated', 'date');
SELECT has_column('aggregated', 'node');
SELECT col_type_is('aggregated', 'node', 'node');
SELECT col_not_null('aggregated', 'node');
SELECT has_column('aggregated', 'country');
-SELECT col_type_is('aggregated', 'country', 'CHARACTER VARYING(2)');
+SELECT col_type_is('aggregated', 'country', 'character varying(2)');
SELECT col_not_null('aggregated', 'country');
SELECT col_default_is('aggregated', 'country', '');
SELECT has_column('aggregated', 'transport');
-SELECT col_type_is('aggregated', 'transport', 'CHARACTER VARYING(20)');
+SELECT col_type_is('aggregated', 'transport', 'character varying(20)');
SELECT col_not_null('aggregated', 'transport');
SELECT col_default_is('aggregated', 'transport', '');
SELECT has_column('aggregated', 'version');
-SELECT col_type_is('aggregated', 'version', 'CHARACTER VARYING(2)');
+SELECT col_type_is('aggregated', 'version', 'character varying(2)');
SELECT col_not_null('aggregated', 'version');
SELECT col_default_is('aggregated', 'version', '');
SELECT has_column('aggregated', 'rrx');
-SELECT col_type_is('aggregated', 'rrx', 'DOUBLE PRECISION');
+SELECT col_type_is('aggregated', 'rrx', 'double precision');
SELECT col_not_null('aggregated', 'rrx');
SELECT col_default_is('aggregated', 'rrx', 0);
SELECT has_column('aggregated', 'nrx');
-SELECT col_type_is('aggregated', 'nrx', 'DOUBLE PRECISION');
+SELECT col_type_is('aggregated', 'nrx', 'double precision');
SELECT col_not_null('aggregated', 'nrx');
SELECT col_default_is('aggregated', 'nrx', 0);
SELECT has_column('aggregated', 'hh');
-SELECT col_type_is('aggregated', 'hh', 'DOUBLE PRECISION');
+SELECT col_type_is('aggregated', 'hh', 'double precision');
SELECT col_not_null('aggregated', 'hh');
SELECT col_default_is('aggregated', 'hh', 0);
SELECT has_column('aggregated', 'nn');
-SELECT col_type_is('aggregated', 'nn', 'DOUBLE PRECISION');
+SELECT col_type_is('aggregated', 'nn', 'double precision');
SELECT col_not_null('aggregated', 'nn');
SELECT col_default_is('aggregated', 'nn', 0);
SELECT has_column('aggregated', 'hrh');
-SELECT col_type_is('aggregated', 'hrh', 'DOUBLE PRECISION');
+SELECT col_type_is('aggregated', 'hrh', 'double precision');
SELECT col_not_null('aggregated', 'hrh');
SELECT col_default_is('aggregated', 'hrh', 0);
SELECT has_column('aggregated', 'nh');
-SELECT col_type_is('aggregated', 'nh', 'DOUBLE PRECISION');
+SELECT col_type_is('aggregated', 'nh', 'double precision');
SELECT col_not_null('aggregated', 'nh');
SELECT col_default_is('aggregated', 'nh', 0);
SELECT has_column('aggregated', 'nrh');
-SELECT col_type_is('aggregated', 'nrh', 'DOUBLE PRECISION');
+SELECT col_type_is('aggregated', 'nrh', 'double precision');
SELECT col_not_null('aggregated', 'nrh');
SELECT col_default_is('aggregated', 'nrh', 0);
@@ -153,7 +153,7 @@ CREATE TEMPORARY TABLE imported (
);
CREATE TEMPORARY TABLE merged (
id SERIAL PRIMARY KEY,
- fingerprint CHARACTER(40) NOT NULL,
+ fingerprint character(40) NOT NULL,
node node NOT NULL,
metric metric NOT NULL,
country CHARACTER VARYING(2) NOT NULL,
@@ -164,7 +164,7 @@ CREATE TEMPORARY TABLE merged (
val DOUBLE PRECISION NOT NULL
);
CREATE TEMPORARY TABLE aggregated (
- date DATE NOT NULL,
+ date date NOT NULL,
node node NOT NULL,
country CHARACTER VARYING(2) NOT NULL DEFAULT '',
transport CHARACTER VARYING(20) NOT NULL DEFAULT '',
@@ -179,13 +179,13 @@ CREATE TEMPORARY TABLE aggregated (
);
-- Test merging newly imported data.
-PREPARE new_imported(TIMESTAMP WITHOUT TIME ZONE,
- TIMESTAMP WITHOUT TIME ZONE) AS INSERT INTO imported
+PREPARE new_imported(timestamp without time zone,
+ timestamp without time zone) AS INSERT INTO imported
(fingerprint, node, metric, country, transport, version, stats_start,
stats_end, val) VALUES ('1234567890123456789012345678901234567890',
'relay', 'status', '', '', '', $1, $2, 0);
-PREPARE new_merged(TIMESTAMP WITHOUT TIME ZONE,
- TIMESTAMP WITHOUT TIME ZONE) AS INSERT INTO merged
+PREPARE new_merged(timestamp without time zone,
+ timestamp without time zone) AS INSERT INTO merged
(fingerprint, node, metric, country, transport, version, stats_start,
stats_end, val) VALUES ('1234567890123456789012345678901234567890',
'relay', 'status', '', '', '', $1, $2, 0);
@@ -193,35 +193,35 @@ PREPARE new_merged(TIMESTAMP WITHOUT TIME ZONE,
EXECUTE new_imported('2013-04-11 14:00:00', '2013-04-11 15:00:00');
SELECT merge();
SELECT bag_eq('SELECT stats_end FROM merged',
- $$VALUES ('2013-04-11 15:00:00'::TIMESTAMP WITHOUT TIME ZONE)$$,
+ $$VALUES ('2013-04-11 15:00:00'::timestamp without time zone)$$,
'Should insert new entry into empty table as is');
DELETE FROM imported;
DELETE FROM merged;
EXECUTE new_imported('2013-04-11 13:00:00', '2013-04-11 14:00:00');
EXECUTE new_imported('2013-04-11 16:00:00', '2013-04-11 17:00:00');
-SELECT merge();
+-- SELECT merge(); -- TODO fix: ERROR: relation "merged_part" already exists
SELECT bag_eq('SELECT stats_end FROM merged',
- $$VALUES ('2013-04-11 14:00:00'::TIMESTAMP WITHOUT TIME ZONE),
- ('2013-04-11 17:00:00'::TIMESTAMP WITHOUT TIME ZONE)$$,
+ $$VALUES ('2013-04-11 14:00:00'::timestamp without time zone),
+ ('2013-04-11 17:00:00'::timestamp without time zone)$$,
'Should insert two non-contiguous entries');
DELETE FROM imported;
DELETE FROM merged;
EXECUTE new_imported('2013-04-11 13:00:00', '2013-04-11 15:00:00');
EXECUTE new_imported('2013-04-11 15:00:00', '2013-04-11 17:00:00');
-SELECT merge();
+-- SELECT merge(); -- TODO fix: ERROR: relation "merged_part" already exists
SELECT bag_eq('SELECT stats_end FROM merged',
- $$VALUES ('2013-04-11 17:00:00'::TIMESTAMP WITHOUT TIME ZONE)$$,
+ $$VALUES ('2013-04-11 17:00:00'::timestamp without time zone)$$,
'Should merge two contiguous entries');
DELETE FROM imported;
DELETE FROM merged;
EXECUTE new_imported('2013-04-11 13:00:00', '2013-04-11 16:00:00');
EXECUTE new_imported('2013-04-11 14:00:00', '2013-04-11 17:00:00');
-SELECT merge();
+-- SELECT merge(); -- TODO fix: ERROR: relation "merged_part" already exists
SELECT bag_eq('SELECT stats_end FROM merged',
- $$VALUES ('2013-04-11 16:00:00'::TIMESTAMP WITHOUT TIME ZONE)$$,
+ $$VALUES ('2013-04-11 16:00:00'::timestamp without time zone)$$,
'Should skip entry that starts before and ends after the start of ' ||
'another new entry');
DELETE FROM imported;
@@ -229,9 +229,9 @@ DELETE FROM merged;
EXECUTE new_imported('2013-04-11 13:00:00', '2013-04-11 15:00:00');
EXECUTE new_imported('2013-04-11 13:00:00', '2013-04-11 16:00:00');
-SELECT merge();
+-- SELECT merge(); -- TODO fix: ERROR: relation "merged_part" already exists
SELECT bag_eq('SELECT stats_end FROM merged',
- $$VALUES ('2013-04-11 15:00:00'::TIMESTAMP WITHOUT TIME ZONE)$$,
+ $$VALUES ('2013-04-11 15:00:00'::timestamp without time zone)$$,
'Should skip entry that starts at and ends after the start of ' ||
'another new entry');
DELETE FROM imported;
@@ -239,9 +239,9 @@ DELETE FROM merged;
EXECUTE new_imported('2013-04-11 13:00:00', '2013-04-11 16:00:00');
EXECUTE new_imported('2013-04-11 14:00:00', '2013-04-11 15:00:00');
-SELECT merge();
+-- SELECT merge(); -- TODO fix: ERROR: relation "merged_part" already exists
SELECT bag_eq('SELECT stats_end FROM merged',
- $$VALUES ('2013-04-11 16:00:00'::TIMESTAMP WITHOUT TIME ZONE)$$,
+ $$VALUES ('2013-04-11 16:00:00'::timestamp without time zone)$$,
'Should skip entry that starts after another new entry starts and ' ||
'ends before that entry ends');
DELETE FROM imported;
@@ -249,18 +249,18 @@ DELETE FROM merged;
EXECUTE new_imported('2013-04-11 13:00:00', '2013-04-11 16:00:00');
EXECUTE new_imported('2013-04-11 13:00:00', '2013-04-11 16:00:00');
-SELECT merge();
+-- SELECT merge(); -- TODO fix: ERROR: relation "merged_part" already exists
SELECT bag_eq('SELECT stats_end FROM merged',
- $$VALUES ('2013-04-11 16:00:00'::TIMESTAMP WITHOUT TIME ZONE)$$,
+ $$VALUES ('2013-04-11 16:00:00'::timestamp without time zone)$$,
'Should skip entry that has same start and end as another new entry');
DELETE FROM imported;
DELETE FROM merged;
EXECUTE new_imported('2013-04-11 13:00:00', '2013-04-11 16:00:00');
EXECUTE new_imported('2013-04-11 14:00:00', '2013-04-11 16:00:00');
-SELECT merge();
+-- SELECT merge(); -- TODO fix: ERROR: relation "merged_part" already exists
SELECT bag_eq('SELECT stats_end FROM merged',
- $$VALUES ('2013-04-11 16:00:00'::TIMESTAMP WITHOUT TIME ZONE)$$,
+ $$VALUES ('2013-04-11 16:00:00'::timestamp without time zone)$$,
'Should skip entry that starts before and ends at the end of ' ||
'another new entry');
DELETE FROM imported;
@@ -268,28 +268,28 @@ DELETE FROM merged;
EXECUTE new_merged('2013-04-11 16:00:00', '2013-04-11 17:00:00');
EXECUTE new_imported('2013-04-11 14:00:00', '2013-04-11 15:00:00');
-SELECT merge();
+-- SELECT merge(); -- TODO fix: ERROR: relation "merged_part" already exists
SELECT bag_eq('SELECT stats_end FROM merged',
- $$VALUES ('2013-04-11 15:00:00'::TIMESTAMP WITHOUT TIME ZONE),
- ('2013-04-11 17:00:00'::TIMESTAMP WITHOUT TIME ZONE)$$,
+ $$VALUES ('2013-04-11 15:00:00'::timestamp without time zone),
+ ('2013-04-11 17:00:00'::timestamp without time zone)$$,
'Should insert entry that ends before existing entry starts');
DELETE FROM imported;
DELETE FROM merged;
EXECUTE new_merged('2013-04-11 15:00:00', '2013-04-11 16:00:00');
EXECUTE new_imported('2013-04-11 14:00:00', '2013-04-11 15:00:00');
-SELECT merge();
+-- SELECT merge(); -- TODO fix: ERROR: relation "merged_part" already exists
SELECT bag_eq('SELECT stats_end FROM merged',
- $$VALUES ('2013-04-11 16:00:00'::TIMESTAMP WITHOUT TIME ZONE)$$,
+ $$VALUES ('2013-04-11 16:00:00'::timestamp without time zone)$$,
'Should merge entry that ends when existing entry starts');
DELETE FROM imported;
DELETE FROM merged;
EXECUTE new_merged('2013-04-11 14:00:00', '2013-04-11 15:00:00');
EXECUTE new_imported('2013-04-11 13:00:00', '2013-04-11 14:30:00');
-SELECT merge();
+-- SELECT merge(); -- TODO fix: ERROR: relation "merged_part" already exists
SELECT bag_eq('SELECT stats_start FROM merged',
- $$VALUES ('2013-04-11 14:00:00'::TIMESTAMP WITHOUT TIME ZONE)$$,
+ $$VALUES ('2013-04-11 14:00:00'::timestamp without time zone)$$,
'Should skip entry that starts before but ends after existing entry ' ||
'starts');
DELETE FROM imported;
@@ -298,10 +298,10 @@ DELETE FROM merged;
EXECUTE new_merged('2013-04-11 11:00:00', '2013-04-11 13:00:00');
EXECUTE new_merged('2013-04-11 14:00:00', '2013-04-11 16:00:00');
EXECUTE new_imported('2013-04-11 13:00:00', '2013-04-11 15:00:00');
-SELECT merge();
+-- SELECT merge(); -- TODO fix: ERROR: relation "merged_part" already exists
SELECT bag_eq('SELECT stats_end FROM merged',
- $$VALUES ('2013-04-11 13:00:00'::TIMESTAMP WITHOUT TIME ZONE),
- ('2013-04-11 16:00:00'::TIMESTAMP WITHOUT TIME ZONE)$$,
+ $$VALUES ('2013-04-11 13:00:00'::timestamp without time zone),
+ ('2013-04-11 16:00:00'::timestamp without time zone)$$,
'Should skip entry that starts when existing entry ends but ' ||
'ends before another entry starts');
DELETE FROM imported;
@@ -309,45 +309,45 @@ DELETE FROM merged;
EXECUTE new_merged('2013-04-11 14:00:00', '2013-04-11 17:00:00');
EXECUTE new_imported('2013-04-11 14:00:00', '2013-04-11 15:00:00');
-SELECT merge();
+-- SELECT merge(); -- TODO fix: ERROR: relation "merged_part" already exists
SELECT bag_eq('SELECT stats_end FROM merged',
- $$VALUES ('2013-04-11 17:00:00'::TIMESTAMP WITHOUT TIME ZONE)$$,
+ $$VALUES ('2013-04-11 17:00:00'::timestamp without time zone)$$,
'Should skip entry that starts when existing entry starts');
DELETE FROM imported;
DELETE FROM merged;
EXECUTE new_merged('2013-04-11 14:00:00', '2013-04-11 17:00:00');
EXECUTE new_imported('2013-04-11 15:00:00', '2013-04-11 16:00:00');
-SELECT merge();
+-- SELECT merge(); -- TODO fix: ERROR: relation "merged_part" already exists
SELECT bag_eq('SELECT stats_end FROM merged',
- $$VALUES ('2013-04-11 17:00:00'::TIMESTAMP WITHOUT TIME ZONE)$$,
+ $$VALUES ('2013-04-11 17:00:00'::timestamp without time zone)$$,
'Should skip entry that starts after and ends before existing entry');
DELETE FROM imported;
DELETE FROM merged;
EXECUTE new_merged('2013-04-11 14:00:00', '2013-04-11 17:00:00');
EXECUTE new_imported('2013-04-11 14:00:00', '2013-04-11 17:00:00');
-SELECT merge();
+-- SELECT merge(); -- TODO fix: ERROR: relation "merged_part" already exists
SELECT bag_eq('SELECT stats_end FROM merged',
- $$VALUES ('2013-04-11 17:00:00'::TIMESTAMP WITHOUT TIME ZONE)$$,
+ $$VALUES ('2013-04-11 17:00:00'::timestamp without time zone)$$,
'Should skip entry that is already contained');
DELETE FROM imported;
DELETE FROM merged;
EXECUTE new_merged('2013-04-11 14:00:00', '2013-04-11 17:00:00');
EXECUTE new_imported('2013-04-11 16:00:00', '2013-04-11 17:00:00');
-SELECT merge();
+-- SELECT merge(); -- TODO fix: ERROR: relation "merged_part" already exists
SELECT bag_eq('SELECT stats_end FROM merged',
- $$VALUES ('2013-04-11 17:00:00'::TIMESTAMP WITHOUT TIME ZONE)$$,
+ $$VALUES ('2013-04-11 17:00:00'::timestamp without time zone)$$,
'Should skip entry that ends when existing entry ends');
DELETE FROM imported;
DELETE FROM merged;
EXECUTE new_merged('2013-04-11 14:00:00', '2013-04-11 17:00:00');
EXECUTE new_imported('2013-04-11 16:00:00', '2013-04-11 18:00:00');
-SELECT merge();
+-- SELECT merge(); -- TODO fix: ERROR: relation "merged_part" already exists
SELECT bag_eq('SELECT stats_end FROM merged',
- $$VALUES ('2013-04-11 17:00:00'::TIMESTAMP WITHOUT TIME ZONE)$$,
+ $$VALUES ('2013-04-11 17:00:00'::timestamp without time zone)$$,
'Should skip entry that starts before but ends after existing entry ' ||
'ends');
DELETE FROM imported;
@@ -356,10 +356,10 @@ DELETE FROM merged;
EXECUTE new_merged('2013-04-11 14:00:00', '2013-04-11 17:00:00');
EXECUTE new_merged('2013-04-11 18:00:00', '2013-04-11 19:00:00');
EXECUTE new_imported('2013-04-11 16:00:00', '2013-04-11 18:00:00');
-SELECT merge();
+-- SELECT merge(); -- TODO fix: ERROR: relation "merged_part" already exists
SELECT bag_eq('SELECT stats_end FROM merged',
- $$VALUES ('2013-04-11 17:00:00'::TIMESTAMP WITHOUT TIME ZONE),
- ('2013-04-11 19:00:00'::TIMESTAMP WITHOUT TIME ZONE)$$,
+ $$VALUES ('2013-04-11 17:00:00'::timestamp without time zone),
+ ('2013-04-11 19:00:00'::timestamp without time zone)$$,
'Should skip entry that starts before existing entry ends and ends ' ||
'when another entry starts');
DELETE FROM imported;
@@ -368,10 +368,10 @@ DELETE FROM merged;
EXECUTE new_merged('2013-04-11 11:00:00', '2013-04-11 13:00:00');
EXECUTE new_merged('2013-04-11 15:00:00', '2013-04-11 17:00:00');
EXECUTE new_imported('2013-04-11 12:00:00', '2013-04-11 16:00:00');
-SELECT merge();
+-- SELECT merge(); -- TODO fix: ERROR: relation "merged_part" already exists
SELECT bag_eq('SELECT stats_end FROM merged',
- $$VALUES ('2013-04-11 13:00:00'::TIMESTAMP WITHOUT TIME ZONE),
- ('2013-04-11 17:00:00'::TIMESTAMP WITHOUT TIME ZONE)$$,
+ $$VALUES ('2013-04-11 13:00:00'::timestamp without time zone),
+ ('2013-04-11 17:00:00'::timestamp without time zone)$$,
'Should skip entry that starts before existing entry ends and ends ' ||
'after another entry starts');
DELETE FROM imported;
@@ -379,28 +379,28 @@ DELETE FROM merged;
EXECUTE new_merged('2013-04-11 14:00:00', '2013-04-11 15:00:00');
EXECUTE new_imported('2013-04-11 15:00:00', '2013-04-11 16:00:00');
-SELECT merge();
+-- SELECT merge(); -- TODO fix: ERROR: relation "merged_part" already exists
SELECT bag_eq('SELECT stats_end FROM merged',
- $$VALUES ('2013-04-11 16:00:00'::TIMESTAMP WITHOUT TIME ZONE)$$,
+ $$VALUES ('2013-04-11 16:00:00'::timestamp without time zone)$$,
'Should merge entry that ends when existing entry starts');
DELETE FROM imported;
DELETE FROM merged;
EXECUTE new_merged('2013-04-11 14:00:00', '2013-04-11 15:00:00');
EXECUTE new_imported('2013-04-11 16:00:00', '2013-04-11 17:00:00');
-SELECT merge();
+-- SELECT merge(); -- TODO fix: ERROR: relation "merged_part" already exists
SELECT bag_eq('SELECT stats_end FROM merged',
- $$VALUES ('2013-04-11 15:00:00'::TIMESTAMP WITHOUT TIME ZONE),
- ('2013-04-11 17:00:00'::TIMESTAMP WITHOUT TIME ZONE)$$,
+ $$VALUES ('2013-04-11 15:00:00'::timestamp without time zone),
+ ('2013-04-11 17:00:00'::timestamp without time zone)$$,
'Should insert entry that starts after existing entry ends');
DELETE FROM imported;
DELETE FROM merged;
EXECUTE new_merged('2013-04-11 15:00:00', '2013-04-11 16:00:00');
EXECUTE new_imported('2013-04-11 14:00:00', '2013-04-11 17:00:00');
-SELECT merge();
+-- SELECT merge(); -- TODO fix: ERROR: relation "merged_part" already exists
SELECT bag_eq('SELECT stats_end FROM merged',
- $$VALUES ('2013-04-11 16:00:00'::TIMESTAMP WITHOUT TIME ZONE)$$,
+ $$VALUES ('2013-04-11 16:00:00'::timestamp without time zone)$$,
'Should skip entry that starts before existing entry starts and ' ||
'ends after that entry ends');
DELETE FROM imported;
@@ -409,10 +409,10 @@ DELETE FROM merged;
EXECUTE new_merged('2013-04-11 13:00:00', '2013-04-11 14:00:00');
EXECUTE new_merged('2013-04-11 15:00:00', '2013-04-11 16:00:00');
EXECUTE new_imported('2013-04-11 12:00:00', '2013-04-11 17:00:00');
-SELECT merge();
+-- SELECT merge(); -- TODO fix: ERROR: relation "merged_part" already exists
SELECT bag_eq('SELECT stats_end FROM merged',
- $$VALUES ('2013-04-11 14:00:00'::TIMESTAMP WITHOUT TIME ZONE),
- ('2013-04-11 16:00:00'::TIMESTAMP WITHOUT TIME ZONE)$$,
+ $$VALUES ('2013-04-11 14:00:00'::timestamp without time zone),
+ ('2013-04-11 16:00:00'::timestamp without time zone)$$,
'Should skip entry that starts before and ends after multiple ' ||
'existing entries');
DELETE FROM imported;
@@ -420,10 +420,10 @@ DELETE FROM merged;
EXECUTE new_imported('2013-04-11 23:00:00', '2013-04-12 00:00:00');
EXECUTE new_imported('2013-04-12 00:00:00', '2013-04-12 01:00:00');
-SELECT merge();
+-- SELECT merge(); -- TODO fix: ERROR: relation "merged_part" already exists
SELECT bag_eq('SELECT stats_end FROM merged',
- $$VALUES ('2013-04-12 00:00:00'::TIMESTAMP WITHOUT TIME ZONE),
- ('2013-04-12 01:00:00'::TIMESTAMP WITHOUT TIME ZONE)$$,
+ $$VALUES ('2013-04-12 00:00:00'::timestamp without time zone),
+ ('2013-04-12 01:00:00'::timestamp without time zone)$$,
'Should insert two contiguous entries that end and start at midnight');
DELETE FROM imported;
DELETE FROM merged;
@@ -433,10 +433,10 @@ INSERT INTO imported (fingerprint, node, metric, country, transport,
version, stats_start, stats_end, val) VALUES
('9876543210987654321098765432109876543210', 'relay', 'status', '', '',
'', '2013-04-11 12:00:00', '2013-04-11 17:00:00', 0);
-SELECT merge();
+-- SELECT merge(); -- TODO fix: ERROR: relation "merged_part" already exists
SELECT bag_eq('SELECT stats_end FROM merged',
- $$VALUES ('2013-04-11 17:00:00'::TIMESTAMP WITHOUT TIME ZONE),
- ('2013-04-11 17:00:00'::TIMESTAMP WITHOUT TIME ZONE)$$,
+ $$VALUES ('2013-04-11 17:00:00'::timestamp without time zone),
+ ('2013-04-11 17:00:00'::timestamp without time zone)$$,
'Should import two entries with different fingerprints and same ' ||
'start and end');
DELETE FROM imported;
@@ -447,10 +447,10 @@ INSERT INTO imported (fingerprint, node, metric, country, transport,
version, stats_start, stats_end, val) VALUES
('9876543210987654321098765432109876543210', 'relay', 'status', '', '',
'', '2013-04-11 14:00:00', '2013-04-11 16:00:00', 0);
-SELECT merge();
+-- SELECT merge(); -- TODO fix: ERROR: relation "merged_part" already exists
SELECT bag_eq('SELECT stats_end FROM merged',
- $$VALUES ('2013-04-11 15:00:00'::TIMESTAMP WITHOUT TIME ZONE),
- ('2013-04-11 16:00:00'::TIMESTAMP WITHOUT TIME ZONE)$$,
+ $$VALUES ('2013-04-11 15:00:00'::timestamp without time zone),
+ ('2013-04-11 16:00:00'::timestamp without time zone)$$,
'Should import two entries with overlapping starts and ends and ' ||
'different fingerprints');
DELETE FROM imported;
@@ -462,19 +462,19 @@ DELETE FROM merged;
-- for the .csv export.
SELECT has_view('estimated');
SELECT has_column('estimated', 'date');
-SELECT col_type_is('estimated', 'date', 'DATE');
+SELECT col_type_is('estimated', 'date', 'date');
SELECT has_column('estimated', 'node');
SELECT col_type_is('estimated', 'node', 'node');
SELECT has_column('estimated', 'country');
-SELECT col_type_is('estimated', 'country', 'CHARACTER VARYING(2)');
+SELECT col_type_is('estimated', 'country', 'character varying(2)');
SELECT has_column('estimated', 'transport');
-SELECT col_type_is('estimated', 'transport', 'CHARACTER VARYING(20)');
+SELECT col_type_is('estimated', 'transport', 'character varying(20)');
SELECT has_column('estimated', 'version');
-SELECT col_type_is('estimated', 'version', 'CHARACTER VARYING(2)');
+SELECT col_type_is('estimated', 'version', 'character varying(2)');
SELECT has_column('estimated', 'frac');
-SELECT col_type_is('estimated', 'frac', 'INTEGER');
+SELECT col_type_is('estimated', 'frac', 'integer');
SELECT has_column('estimated', 'users');
-SELECT col_type_is('estimated', 'users', 'INTEGER');
+SELECT col_type_is('estimated', 'users', 'integer');
-- TODO Test that frac and users are computed correctly in the view.
More information about the tor-commits
mailing list