Skip to content
This repository was archived by the owner on Apr 1, 2026. It is now read-only.

Commit 4a2626a

Browse files
committed
skip unsupported emulator tests
1 parent 9d3588a commit 4a2626a

File tree

2 files changed

+90
-0
lines changed

2 files changed

+90
-0
lines changed

tests/system/data/test_metrics_async.py

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
CompletedAttemptMetric,
2828
)
2929
from google.cloud.bigtable_v2.types import ResponseParams
30+
from google.cloud.environment_vars import BIGTABLE_EMULATOR
3031

3132
from google.cloud.bigtable.data._cross_sync import CrossSync
3233

@@ -223,6 +224,9 @@ async def authorized_view(
223224
table._metrics.add_handler(handler)
224225
yield table
225226

227+
@pytest.mark.skipif(
228+
bool(os.environ.get(BIGTABLE_EMULATOR)), reason="emulator doesn't suport cluster_config"
229+
)
226230
@CrossSync.pytest
227231
async def test_mutate_row(self, table, temp_rows, handler, cluster_config):
228232
row_key = b"mutate"
@@ -313,6 +317,9 @@ async def test_mutate_row_failure_with_retries(
313317
assert final_attempt.end_status.name == "PERMISSION_DENIED"
314318
assert final_attempt.gfe_latency_ns is None
315319

320+
@pytest.mark.skipif(
321+
bool(os.environ.get(BIGTABLE_EMULATOR)), reason="not supported by emulator"
322+
)
316323
@CrossSync.pytest
317324
async def test_mutate_row_failure_timeout(self, table, temp_rows, handler):
318325
"""
@@ -345,6 +352,9 @@ async def test_mutate_row_failure_timeout(self, table, temp_rows, handler):
345352
assert attempt.end_status.name == "DEADLINE_EXCEEDED"
346353
assert attempt.gfe_latency_ns is None
347354

355+
@pytest.mark.skipif(
356+
bool(os.environ.get(BIGTABLE_EMULATOR)), reason="emulator doesn't suport cluster_config"
357+
)
348358
@CrossSync.pytest
349359
async def test_mutate_row_failure_unauthorized(
350360
self, handler, authorized_view, cluster_config
@@ -384,6 +394,9 @@ async def test_mutate_row_failure_unauthorized(
384394
and attempt.gfe_latency_ns < operation.duration_ns
385395
)
386396

397+
@pytest.mark.skipif(
398+
bool(os.environ.get(BIGTABLE_EMULATOR)), reason="emulator doesn't suport cluster_config"
399+
)
387400
@CrossSync.pytest
388401
async def test_mutate_row_failure_unauthorized_with_retries(
389402
self, handler, authorized_view, cluster_config
@@ -423,6 +436,9 @@ async def test_mutate_row_failure_unauthorized_with_retries(
423436
for attempt in handler.completed_attempts:
424437
assert attempt.end_status.name in ["PERMISSION_DENIED", "DEADLINE_EXCEEDED"]
425438

439+
@pytest.mark.skipif(
440+
bool(os.environ.get(BIGTABLE_EMULATOR)), reason="emulator doesn't suport cluster_config"
441+
)
426442
@CrossSync.pytest
427443
async def test_sample_row_keys(self, table, temp_rows, handler, cluster_config):
428444
await table.sample_row_keys()
@@ -499,6 +515,10 @@ async def test_sample_row_keys_failure_cancelled(
499515
assert final_attempt.end_status.name == "UNKNOWN"
500516
assert final_attempt.gfe_latency_ns is None
501517

518+
519+
@pytest.mark.skipif(
520+
bool(os.environ.get(BIGTABLE_EMULATOR)), reason="emulator doesn't suport cluster_config"
521+
)
502522
@CrossSync.pytest
503523
async def test_sample_row_keys_failure_with_retries(
504524
self, table, temp_rows, handler, error_injector, cluster_config
@@ -541,6 +561,9 @@ async def test_sample_row_keys_failure_with_retries(
541561
and final_attempt.gfe_latency_ns < operation.duration_ns
542562
)
543563

564+
@pytest.mark.skipif(
565+
bool(os.environ.get(BIGTABLE_EMULATOR)), reason="not supported by emulator"
566+
)
544567
@CrossSync.pytest
545568
async def test_sample_row_keys_failure_timeout(self, table, handler):
546569
"""
@@ -596,6 +619,10 @@ async def test_sample_row_keys_failure_mid_stream(
596619
final_attempt = handler.completed_attempts[-1]
597620
assert final_attempt.end_status.name == "PERMISSION_DENIED"
598621

622+
623+
@pytest.mark.skipif(
624+
bool(os.environ.get(BIGTABLE_EMULATOR)), reason="emulator doesn't suport cluster_config"
625+
)
599626
@CrossSync.pytest
600627
async def test_read_modify_write(self, table, temp_rows, handler, cluster_config):
601628
from google.cloud.bigtable.data.read_modify_write_rules import IncrementRule
@@ -689,6 +716,9 @@ async def test_read_modify_write_failure_cancelled(
689716
assert attempt.gfe_latency_ns is None
690717
assert attempt.application_blocking_time_ns == 0
691718

719+
@pytest.mark.skipif(
720+
bool(os.environ.get(BIGTABLE_EMULATOR)), reason="not supported by emulator"
721+
)
692722
@CrossSync.pytest
693723
async def test_read_modify_write_failure_timeout(self, table, temp_rows, handler):
694724
"""
@@ -719,6 +749,9 @@ async def test_read_modify_write_failure_timeout(self, table, temp_rows, handler
719749
attempt = handler.completed_attempts[0]
720750
assert attempt.gfe_latency_ns is None
721751

752+
@pytest.mark.skipif(
753+
bool(os.environ.get(BIGTABLE_EMULATOR)), reason="not supported by emulator"
754+
)
722755
@CrossSync.pytest
723756
async def test_read_modify_write_failure_unauthorized(
724757
self, handler, authorized_view, cluster_config
@@ -753,6 +786,9 @@ async def test_read_modify_write_failure_unauthorized(
753786
and attempt.gfe_latency_ns < operation.duration_ns
754787
)
755788

789+
@pytest.mark.skipif(
790+
bool(os.environ.get(BIGTABLE_EMULATOR)), reason="emulator doesn't suport cluster_config"
791+
)
756792
@CrossSync.pytest
757793
async def test_check_and_mutate_row(
758794
self, table, temp_rows, handler, cluster_config
@@ -859,6 +895,9 @@ async def test_check_and_mutate_row_failure_cancelled(
859895
assert attempt.gfe_latency_ns is None
860896
assert attempt.application_blocking_time_ns == 0
861897

898+
@pytest.mark.skipif(
899+
bool(os.environ.get(BIGTABLE_EMULATOR)), reason="not supported by emulator"
900+
)
862901
@CrossSync.pytest
863902
async def test_check_and_mutate_row_failure_timeout(
864903
self, table, temp_rows, handler
@@ -900,6 +939,9 @@ async def test_check_and_mutate_row_failure_timeout(
900939
attempt = handler.completed_attempts[0]
901940
assert attempt.gfe_latency_ns is None
902941

942+
@pytest.mark.skipif(
943+
bool(os.environ.get(BIGTABLE_EMULATOR)), reason="emulator doesn't suport cluster_config"
944+
)
903945
@CrossSync.pytest
904946
async def test_check_and_mutate_row_failure_unauthorized(
905947
self, handler, authorized_view, cluster_config

tests/system/data/test_metrics_autogen.py

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
CompletedAttemptMetric,
2828
)
2929
from google.cloud.bigtable_v2.types import ResponseParams
30+
from google.cloud.environment_vars import BIGTABLE_EMULATOR
3031
from google.cloud.bigtable.data._cross_sync import CrossSync
3132
from . import TEST_FAMILY, SystemTestRunner
3233
from grpc import UnaryUnaryClientInterceptor
@@ -183,6 +184,10 @@ def authorized_view(
183184
table._metrics.add_handler(handler)
184185
yield table
185186

187+
@pytest.mark.skipif(
188+
bool(os.environ.get(BIGTABLE_EMULATOR)),
189+
reason="emulator doesn't suport cluster_config",
190+
)
186191
def test_mutate_row(self, table, temp_rows, handler, cluster_config):
187192
row_key = b"mutate"
188193
new_value = uuid.uuid4().hex.encode()
@@ -258,6 +263,9 @@ def test_mutate_row_failure_with_retries(self, table, handler, error_injector):
258263
assert final_attempt.end_status.name == "PERMISSION_DENIED"
259264
assert final_attempt.gfe_latency_ns is None
260265

266+
@pytest.mark.skipif(
267+
bool(os.environ.get(BIGTABLE_EMULATOR)), reason="not supported by emulator"
268+
)
261269
def test_mutate_row_failure_timeout(self, table, temp_rows, handler):
262270
"""Test failure in gapic layer by passing very low timeout
263271
@@ -283,6 +291,10 @@ def test_mutate_row_failure_timeout(self, table, temp_rows, handler):
283291
assert attempt.end_status.name == "DEADLINE_EXCEEDED"
284292
assert attempt.gfe_latency_ns is None
285293

294+
@pytest.mark.skipif(
295+
bool(os.environ.get(BIGTABLE_EMULATOR)),
296+
reason="emulator doesn't suport cluster_config",
297+
)
286298
def test_mutate_row_failure_unauthorized(
287299
self, handler, authorized_view, cluster_config
288300
):
@@ -315,6 +327,10 @@ def test_mutate_row_failure_unauthorized(
315327
and attempt.gfe_latency_ns < operation.duration_ns
316328
)
317329

330+
@pytest.mark.skipif(
331+
bool(os.environ.get(BIGTABLE_EMULATOR)),
332+
reason="emulator doesn't suport cluster_config",
333+
)
318334
def test_mutate_row_failure_unauthorized_with_retries(
319335
self, handler, authorized_view, cluster_config
320336
):
@@ -347,6 +363,10 @@ def test_mutate_row_failure_unauthorized_with_retries(
347363
for attempt in handler.completed_attempts:
348364
assert attempt.end_status.name in ["PERMISSION_DENIED", "DEADLINE_EXCEEDED"]
349365

366+
@pytest.mark.skipif(
367+
bool(os.environ.get(BIGTABLE_EMULATOR)),
368+
reason="emulator doesn't suport cluster_config",
369+
)
350370
def test_sample_row_keys(self, table, temp_rows, handler, cluster_config):
351371
table.sample_row_keys()
352372
assert len(handler.completed_operations) == 1
@@ -376,6 +396,10 @@ def test_sample_row_keys(self, table, temp_rows, handler, cluster_config):
376396
)
377397
assert attempt.application_blocking_time_ns == 0
378398

399+
@pytest.mark.skipif(
400+
bool(os.environ.get(BIGTABLE_EMULATOR)),
401+
reason="emulator doesn't suport cluster_config",
402+
)
379403
def test_sample_row_keys_failure_with_retries(
380404
self, table, temp_rows, handler, error_injector, cluster_config
381405
):
@@ -412,6 +436,9 @@ def test_sample_row_keys_failure_with_retries(
412436
and final_attempt.gfe_latency_ns < operation.duration_ns
413437
)
414438

439+
@pytest.mark.skipif(
440+
bool(os.environ.get(BIGTABLE_EMULATOR)), reason="not supported by emulator"
441+
)
415442
def test_sample_row_keys_failure_timeout(self, table, handler):
416443
"""Test failure in gapic layer by passing very low timeout
417444
@@ -454,6 +481,10 @@ def test_sample_row_keys_failure_mid_stream(
454481
final_attempt = handler.completed_attempts[-1]
455482
assert final_attempt.end_status.name == "PERMISSION_DENIED"
456483

484+
@pytest.mark.skipif(
485+
bool(os.environ.get(BIGTABLE_EMULATOR)),
486+
reason="emulator doesn't suport cluster_config",
487+
)
457488
def test_read_modify_write(self, table, temp_rows, handler, cluster_config):
458489
from google.cloud.bigtable.data.read_modify_write_rules import IncrementRule
459490

@@ -490,6 +521,9 @@ def test_read_modify_write(self, table, temp_rows, handler, cluster_config):
490521
)
491522
assert attempt.application_blocking_time_ns == 0
492523

524+
@pytest.mark.skipif(
525+
bool(os.environ.get(BIGTABLE_EMULATOR)), reason="not supported by emulator"
526+
)
493527
def test_read_modify_write_failure_timeout(self, table, temp_rows, handler):
494528
"""Test failure in gapic layer by passing very low timeout
495529
@@ -514,6 +548,9 @@ def test_read_modify_write_failure_timeout(self, table, temp_rows, handler):
514548
attempt = handler.completed_attempts[0]
515549
assert attempt.gfe_latency_ns is None
516550

551+
@pytest.mark.skipif(
552+
bool(os.environ.get(BIGTABLE_EMULATOR)), reason="not supported by emulator"
553+
)
517554
def test_read_modify_write_failure_unauthorized(
518555
self, handler, authorized_view, cluster_config
519556
):
@@ -542,6 +579,10 @@ def test_read_modify_write_failure_unauthorized(
542579
and attempt.gfe_latency_ns < operation.duration_ns
543580
)
544581

582+
@pytest.mark.skipif(
583+
bool(os.environ.get(BIGTABLE_EMULATOR)),
584+
reason="emulator doesn't suport cluster_config",
585+
)
545586
def test_check_and_mutate_row(self, table, temp_rows, handler, cluster_config):
546587
from google.cloud.bigtable.data.mutations import SetCell
547588
from google.cloud.bigtable.data.row_filters import ValueRangeFilter
@@ -585,6 +626,9 @@ def test_check_and_mutate_row(self, table, temp_rows, handler, cluster_config):
585626
)
586627
assert attempt.application_blocking_time_ns == 0
587628

629+
@pytest.mark.skipif(
630+
bool(os.environ.get(BIGTABLE_EMULATOR)), reason="not supported by emulator"
631+
)
588632
def test_check_and_mutate_row_failure_timeout(self, table, temp_rows, handler):
589633
"""Test failure in gapic layer by passing very low timeout
590634
@@ -617,6 +661,10 @@ def test_check_and_mutate_row_failure_timeout(self, table, temp_rows, handler):
617661
attempt = handler.completed_attempts[0]
618662
assert attempt.gfe_latency_ns is None
619663

664+
@pytest.mark.skipif(
665+
bool(os.environ.get(BIGTABLE_EMULATOR)),
666+
reason="emulator doesn't suport cluster_config",
667+
)
620668
def test_check_and_mutate_row_failure_unauthorized(
621669
self, handler, authorized_view, cluster_config
622670
):

0 commit comments

Comments
 (0)