# ----------
# $Id$
#
# Regression tests that create/drop the Citus extension in the regression database.
# This schedule includes both prerequisites these tests depend on and downstream tests that depend on them.
# These tests are separated from multi_1_schedule so that the tests remain in there
# do not change the version of the citus extension in regression database.
#
# Also the tests that assume a clean start after extension creation are moved here.
#
# ----------

# ---
# Tests around extension creation / upgrades.
# ---
test: multi_extension
test: multi_test_helpers multi_test_helpers_superuser
test: multi_cluster_management
test: multi_create_fdw

# ---
# Prerequisites for multi_metadata_sync (from citus_tests/run_test.py)
# Tests need a clean start, such as multi_read_from_secondaries
# ---
test: alter_role_propagation
test: multi_test_catalog_views
test: multi_table_ddl
test: multi_sequence_default
test: multi_read_from_secondaries
test: alter_database_propagation

# ----------
# multi_replicate_reference_table tests replicating reference tables to new nodes after we add new nodes
# multi_remove_node_reference_table tests metadata changes after master_remove_node
# ----------
test: multi_replicate_reference_table
test: multi_remove_node_reference_table

# ----------
# Test for tenant statistics
# ----------
test: citus_stat_tenants

test: multi_modifying_xacts
test: multi_transaction_recovery

# ---
# multi_drop_extension makes sure we can safely drop and recreate the extension.
# ---
test: multi_drop_extension

# ---
# multi_metadata_sync tests the propagation of mx-related metadata changes to metadata workers.
# multi_metadata_sync_domain tests that metadata sync works correctly with DOMAIN types in non-public schemas
# ---
test: multi_metadata_sync
test: multi_metadata_sync_domain

test: grant_on_function_propagation
test: grant_on_foreign_server_propagation

# ----------
# grant_on_schema_propagation tests if the GRANT ... ON SCHEMA queries are propagated correctly
# multi_schema_support makes sure we can work with tables in schemas other than public with no problem
# ----------
test: grant_on_schema_propagation
test: multi_schema_support


# ----------
# multi_colocation_utils tests utility functions written for co-location feature & internal API
# ----------
test: multi_colocation_utils

test: coordinator_shouldhaveshards
test: mx_regular_user

# ----------
# multi_multiuser tests simple combinations of permission access and queries
# ----------
test: multi_multiuser

# Don't parallelize stat_counters with others because we don't want statistics
# to be updated by other tests concurrently except Citus Maintenance Daemon.
#
# Also, this needs to be the first test that calls citus_stat_counters()
# because it checks the value of stats_reset column before calling the function.
test: stat_counters

test: function_propagation
test: drop_database
test: pg16
test: multi_transaction_recovery_multiple_databases

# Have this placeholder section at the end for the tests that need to be moved back
# to their original schedules with the next major version of Citus are listed below.
#
# These tests are kept here to prevent N-1 test failures for the features that are
# not present in the minor version.
# ---------------------------------------------------------------------------------

# ----------
# ----------
# multi_unsupported_worker_operations tests that unsupported operations error out on metadata workers
# ----------
test: multi_unsupported_worker_operations

# Don't parallelize the following two tests as they directly alter pg_dist_shardid_seq
# on the coordinator and restore it at the end.
# Will be moved back to multi_1_schedule at Citus 15.
test: schema_based_sharding_from_workers_a
test: schema_based_sharding_from_workers_b

# ----------
# citus_cluster_changes_block tests UDFs introduced in 13.3; not present in the
# N-1 (13.2-1) extension, so run it only under check-multi-1-create-citus which
# is not part of the N-1 test matrix. Move back to multi_schedule at Citus 14.
# ----------
test: citus_cluster_changes_block
