Skip to content

Pr test unification#35021

Draft
def- wants to merge 20 commits intoMaterializeInc:mainfrom
def-:pr-test-unification
Draft

Pr test unification#35021
def- wants to merge 20 commits intoMaterializeInc:mainfrom
def-:pr-test-unification

Conversation

@def-
Copy link
Contributor

@def- def- commented Feb 15, 2026

No description provided.

def- and others added 20 commits February 15, 2026 16:45
…l_workflows()

8 mzcompose.py files had an identical ~8-line workflow_default body that
iterates all workflows as test parts. Extract this into a single method
on Composition and replace the boilerplate with a one-liner call.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ws()

Extend run_all_workflows() to support skipping additional workflows
(beyond 'default') and optionally sharding via Buildkite parallelism.
This deduplicates workflow_default boilerplate in 4 more test files.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ters

Add internally_sharded, args, and between_workflows parameters to
Composition.run_all_workflows() and use them to replace the repeated
"internal sharding + buildkite sharding" boilerplate in 5 CDC test files.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…files()

Add `shard_test_files()` and `glob_test_files()` methods to Composition
that encapsulate the repeated pattern of parsing a filter argument,
globbing for .td files in the test directory, sharding via Buildkite
parallelism, and printing the result. Replace 8 occurrences of this
~10-15 line boilerplate across 6 CDC test files.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…run_scenarios()

Deduplicate the repeated buildkite shard + scenario loop pattern across
5 CDC resumption test files (10 occurrences) into a single reusable
method on Composition.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move duplicated helper functions (create_mysql, create_mysql_replica,
get_targeted_mysql_version, PostgresRecvlogical, create_postgres,
get_targeted_pg_version) from test/mysql-cdc and test/pg-cdc pairs
into shared utility modules, following the existing mysql_util.py
pattern.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…orkflows()

Replace the 29-line workflow_default boilerplate in both mysql-cdc-resumption
and mysql-cdc-resumption-old-syntax with calls to c.run_all_workflows(),
using the exclude, internally_sharded, and between_workflows parameters
added in earlier sessions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…estdrive_size_args()

Replace repeated two-line f-string pairs for default replica/storage size
testdrive vars with a single static method call, improving readability
across 6 CDC and kafka-matrix test files.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ows()

Replace manual workflow_default boilerplate in 3 CDC resumption test
files with c.run_all_workflows(between_workflows=...). Also extract a
run_testdrive_files helper in sql-server-resumption-old-syntax to
eliminate 13 repeated SQL Server credential var pairs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…l_cdc_resumption.py

The two mysql-cdc-resumption mzcompose.py files (675 lines each) differed
by only 1 import line. Extract all 24 shared helper and scenario functions
into a new misc/python/materialize/mysql_cdc_resumption.py module, reducing
each file from 675 to 313 lines (-324 lines net).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…resumption.py

Extract 14 shared functions (helpers + scenarios) from pg-cdc-resumption and
pg-cdc-resumption-old-syntax into a new shared module, eliminating ~280 lines
of duplicated code. The new-syntax file retains its 3 extra scenarios and
pg8000 helpers; the old-syntax file is reduced from 281 to 95 lines.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The SSH setup boilerplate (run setup.td, query public key, authorize on
bastion host) was repeated in 10 workflows. Extract three helpers:
_get_ssh_public_key, _authorize_ssh_key, _setup_and_authorize_ssh.

Net -139 lines (42 added, 181 removed).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add `MySql.default_testdrive_args()` and `SqlServer.default_testdrive_args()`
static methods that return the standard testdrive --var args for MySQL root
password and SQL Server credentials. Replace all 24 inline occurrences across
19 files with calls to these methods, consistent with the existing
`Materialized.default_testdrive_size_args()` pattern.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…s_util.py

Move 5 identical replication slot helper functions from both
pg-cdc/mzcompose.py and pg-cdc-old-syntax/mzcompose.py into the shared
postgres_util.py module. The helpers use the common cursor/execute/fetchall
DB interface and work with both psycopg and pg8000 connection objects.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move 4 identical functions (workflow_cdc, workflow_replica_connection,
workflow_schema_change_restart, _make_inserts) from both mysql-cdc and
mysql-cdc-old-syntax mzcompose.py files into a shared mysql_cdc.py module.
The mzcompose framework discovers imported workflow_* functions via
getmembers(module, isfunction), so no wrapper functions are needed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…rive_ssl_args to postgres_util.py

Move workflow_wal_level, workflow_replication_disabled, and kill_pg_and_mz
into a new shared pg_cdc.py module. Move get_testdrive_ssl_args() from
pg-cdc-old-syntax's local definition to postgres_util.py and use it in
both pg-cdc files, replacing inline SSL cert extraction in pg-cdc.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… in checks

Add a pre-dedented `KAFKA_SCHEMA` constant and a shared
`remove_target_cluster_from_explain()` function to `checks/common.py`,
replacing 12 identical `schemas()`/`schema()` wrapper functions and 5
identical `remove_target_cluster_from_explain()` definitions across 20
check files. Also replaces 3 inline `dedent(KAFKA_SCHEMA_WITH_SINGLE_STRING_FIELD)`
usages with the constant.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…nt_connection_drop into pg_cdc.py

Move 3 shared workflow functions from pg-cdc and pg-cdc-old-syntax
mzcompose.py files into the shared pg_cdc.py module. Each function
is parameterized to handle the minor differences between the two
test suites (exclude list, max_replication_slots, DB connection
library).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace 27 occurrences of the 4-line ALTER SYSTEM SET boilerplate across
9 test files with a single method call on Composition. This makes each
call site clearly express intent rather than exposing port/user details.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…boilerplate

Replace 48 occurrences of the 4-line `c.sql("ALTER SYSTEM SET ...",
port=6877, user="mz_system")` pattern across 16 files with a 1-line
`c.alter_system_set(name, value)` call. The method handles the internal
port and system user automatically and forwards extra kwargs like
`print_statement` and `service`.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link

Pre-merge checklist

  • The PR title is descriptive and will make sense in the git log.
  • This PR has adequate test coverage / QA involvement has been duly considered. (trigger-ci for additional test/nightly runs)
  • If this PR includes major user-facing behavior changes, I have pinged the relevant PM to schedule a changelog post.
  • This PR has an associated up-to-date design doc, is a design doc (template), or is sufficiently small to not require a design.
  • If this PR evolves an existing $T ⇔ Proto$T mapping (possibly in a backwards-incompatible way), then it is tagged with a T-proto label.
  • If this PR will require changes to cloud orchestration or tests, there is a companion cloud PR to account for those changes that is tagged with the release-blocker label (example).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant