Skip to content

Commit 7efe087

Browse files
committed
Remove mock tests
1 parent 7cb516b commit 7efe087

File tree

2 files changed

+1
-53
lines changed

2 files changed

+1
-53
lines changed

sdks/python/apache_beam/yaml/examples/testing/examples_test.py

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -679,9 +679,7 @@ def _kafka_test_preprocessor(
679679
'test_anomaly_scoring_yaml',
680680
'test_wordCountInclude_yaml',
681681
'test_wordCountImport_yaml',
682-
'test_iceberg_to_alloydb_yaml',
683-
'test_iceberg_to_iceberg_streaming_yaml',
684-
'test_iceberg_to_iceberg_batch_yaml'
682+
'test_iceberg_to_alloydb_yaml'
685683
])
686684
def _io_write_test_preprocessor(
687685
test_spec: dict, expected: List[str], env: TestEnvironment):
@@ -794,37 +792,6 @@ def _iceberg_io_read_test_preprocessor(
794792
return test_spec
795793

796794

797-
@YamlExamplesTestSuite.register_test_preprocessor([
798-
'test_iceberg_to_iceberg_streaming_yaml',
799-
'test_iceberg_to_iceberg_batch_yaml'
800-
])
801-
def _iceberg_cdc_read_test_preprocessor(
802-
test_spec: dict, expected: List[str], env: TestEnvironment):
803-
"""
804-
Preprocessor for tests that involve reading CDC events from Iceberg.
805-
806-
This preprocessor replaces any ReadFromIcebergCDC transform with a Create
807-
transform that reads from a predefined in-memory dictionary. This allows
808-
the test to verify the pipeline's correctness without relying on Iceberg
809-
tables stored externally.
810-
"""
811-
if pipeline := test_spec.get('pipeline', None):
812-
for transform in pipeline.get('transforms', []):
813-
if transform.get('type', '') == 'ReadFromIcebergCDC':
814-
config = transform['config']
815-
db_name, table_name = config['table'].split('.')
816-
817-
transform['type'] = 'Create'
818-
transform['config'] = {
819-
k: v
820-
for k, v in config.items() if k.startswith('__')
821-
}
822-
transform['config']['elements'] = INPUT_TABLES[(
823-
config['catalog_name'], db_name, table_name)]
824-
825-
return test_spec
826-
827-
828795
@YamlExamplesTestSuite.register_test_preprocessor([
829796
'test_spanner_read_yaml',
830797
'test_enrich_spanner_with_bigquery_yaml',
@@ -1351,8 +1318,6 @@ def _jinja_preprocessor(raw_spec_string: str, test_name: str):
13511318
('orders-test', 'order-database', 'orders'): input_data.
13521319
spanner_orders_data(),
13531320
('db', 'users', 'NY'): input_data.iceberg_dynamic_destinations_users_data(),
1354-
('shipment_data', 'shipment_dataset_bronze', 'shipments'): input_data.
1355-
shipment_data_filtered(),
13561321
('BigTable', 'beam-test', 'bigtable-enrichment-test'): input_data.
13571322
bigtable_data(),
13581323
('BigQuery', 'ALL_TEST', 'customers'): input_data.bigquery_data(),

sdks/python/apache_beam/yaml/examples/testing/input_data.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -196,23 +196,6 @@ def shipments_data():
196196
}]
197197

198198

199-
def shipment_data_filtered():
200-
return [{
201-
'customer_id': 'C1',
202-
'shipment_date': '2023-05-01',
203-
'shipment_cost': 150.0,
204-
'customer_name': 'Alice',
205-
'customer_email': '[email protected]'
206-
},
207-
{
208-
'customer_id': 'C1',
209-
'shipment_date': '2023-05-10',
210-
'shipment_cost': 20.0,
211-
'customer_name': 'Alice',
212-
'customer_email': '[email protected]'
213-
}]
214-
215-
216199
def bigtable_data():
217200
return [{
218201
'product_id': '1', 'product_name': 'pixel 5', 'product_stock': '2'

0 commit comments

Comments
 (0)