Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor CAgg migrate regression tests #5052

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2,008 changes: 2,008 additions & 0 deletions tsl/test/expected/cagg_migrate.out

Large diffs are not rendered by default.

2,048 changes: 2,048 additions & 0 deletions tsl/test/expected/cagg_migrate_dist_ht.out

Large diffs are not rendered by default.

680 changes: 0 additions & 680 deletions tsl/test/expected/cagg_migrate_integer.out

This file was deleted.

720 changes: 0 additions & 720 deletions tsl/test/expected/cagg_migrate_integer_dist_ht.out

This file was deleted.

652 changes: 0 additions & 652 deletions tsl/test/expected/cagg_migrate_timestamp.out

This file was deleted.

692 changes: 0 additions & 692 deletions tsl/test/expected/cagg_migrate_timestamp_dist_ht.out

This file was deleted.

651 changes: 0 additions & 651 deletions tsl/test/expected/cagg_migrate_timestamptz.out

This file was deleted.

691 changes: 0 additions & 691 deletions tsl/test/expected/cagg_migrate_timestamptz_dist_ht.out

This file was deleted.

8 changes: 2 additions & 6 deletions tsl/test/sql/CMakeLists.txt
Expand Up @@ -56,12 +56,8 @@ if(CMAKE_BUILD_TYPE MATCHES Debug)
cagg_drop_chunks.sql
cagg_dump.sql
cagg_errors_deprecated.sql
cagg_migrate_integer.sql
cagg_migrate_integer_dist_ht.sql
cagg_migrate_timestamp.sql
cagg_migrate_timestamp_dist_ht.sql
cagg_migrate_timestamptz.sql
cagg_migrate_timestamptz_dist_ht.sql
cagg_migrate.sql
cagg_migrate_dist_ht.sql
cagg_multi.sql
cagg_on_cagg_integer.sql
cagg_on_cagg_integer_dist_ht.sql
Expand Down
26 changes: 26 additions & 0 deletions tsl/test/sql/cagg_migrate.sql
@@ -0,0 +1,26 @@
-- This file and its contents are licensed under the Timescale License.
-- Please see the included NOTICE for copyright information and
-- LICENSE-TIMESCALE for a copy of the license.

\set IS_DISTRIBUTED FALSE
\set IS_TIME_DIMENSION FALSE

-- ########################################################
-- ## INTEGER data type tests
-- ########################################################
\set TIME_DIMENSION_DATATYPE INTEGER
\ir include/cagg_migrate_common.sql

-- ########################################################
-- ## TIMESTAMP data type tests
-- ########################################################
\set IS_TIME_DIMENSION TRUE
\set TIME_DIMENSION_DATATYPE TIMESTAMP
\ir include/cagg_migrate_common.sql

-- ########################################################
-- ## TIMESTAMPTZ data type tests
-- ########################################################
\set IS_TIME_DIMENSION TRUE
\set TIME_DIMENSION_DATATYPE TIMESTAMPTZ
\ir include/cagg_migrate_common.sql
Expand Up @@ -22,9 +22,26 @@ FROM (
GRANT USAGE ON FOREIGN SERVER :DATA_NODE_1, :DATA_NODE_2, :DATA_NODE_3 TO PUBLIC;

\set IS_DISTRIBUTED TRUE

-- ########################################################
-- ## INTEGER data type tests
-- ########################################################
\set IS_TIME_DIMENSION FALSE
\set TIME_DIMENSION_DATATYPE INTEGER
\ir include/cagg_migrate_common.sql

-- ########################################################
-- ## TIMESTAMP data type tests
-- ########################################################
\set IS_TIME_DIMENSION TRUE
\set TIME_DIMENSION_DATATYPE TIMESTAMPTZ
\set TIME_DIMENSION_DATATYPE TIMESTAMP
\ir include/cagg_migrate_common.sql

-- ########################################################
-- ## TIMESTAMPTZ data type tests
-- ########################################################
\set IS_TIME_DIMENSION TRUE
\set TIME_DIMENSION_DATATYPE TIMESTAMPTZ
\ir include/cagg_migrate_common.sql

-- cleanup
Expand Down
9 changes: 0 additions & 9 deletions tsl/test/sql/cagg_migrate_integer.sql

This file was deleted.

34 changes: 0 additions & 34 deletions tsl/test/sql/cagg_migrate_integer_dist_ht.sql

This file was deleted.

9 changes: 0 additions & 9 deletions tsl/test/sql/cagg_migrate_timestamp.sql

This file was deleted.

34 changes: 0 additions & 34 deletions tsl/test/sql/cagg_migrate_timestamp_dist_ht.sql

This file was deleted.

9 changes: 0 additions & 9 deletions tsl/test/sql/cagg_migrate_timestamptz.sql

This file was deleted.

11 changes: 9 additions & 2 deletions tsl/test/sql/include/cagg_migrate_common.sql
Expand Up @@ -218,7 +218,7 @@ SELECT * FROM conditions_summary_daily
EXCEPT
SELECT * FROM conditions_summary_daily_new;

CREATE VIEW cagg_jobs AS
CREATE OR REPLACE VIEW cagg_jobs AS
SELECT user_view_schema AS schema, user_view_name AS name, bgw_job.*
FROM _timescaledb_config.bgw_job
JOIN _timescaledb_catalog.continuous_agg ON mat_hypertable_id = hypertable_id
Expand Down Expand Up @@ -348,7 +348,7 @@ CALL cagg_migrate('conditions_summary_daily');
ROLLBACK;
\set ON_ERROR_STOP 1

CREATE FUNCTION execute_migration() RETURNS void AS
CREATE OR REPLACE FUNCTION execute_migration() RETURNS void AS
$$
BEGIN
CALL cagg_migrate('conditions_summary_daily');
Expand All @@ -364,3 +364,10 @@ BEGIN;
SELECT execute_migration();
ROLLBACK;
\set ON_ERROR_STOP 1

-- cleanup
REVOKE SELECT, INSERT, UPDATE ON TABLE _timescaledb_catalog.continuous_agg_migrate_plan FROM :ROLE_DEFAULT_PERM_USER;
REVOKE USAGE ON SEQUENCE _timescaledb_catalog.continuous_agg_migrate_plan_step_step_id_seq FROM :ROLE_DEFAULT_PERM_USER;
TRUNCATE _timescaledb_catalog.continuous_agg_migrate_plan RESTART IDENTITY CASCADE;
DROP MATERIALIZED VIEW conditions_summary_daily;
DROP TABLE conditions;