2727 CompletedAttemptMetric ,
2828)
2929from google .cloud .bigtable_v2 .types import ResponseParams
30+ from google .cloud .environment_vars import BIGTABLE_EMULATOR
3031from google .cloud .bigtable .data ._cross_sync import CrossSync
3132from . import TEST_FAMILY , SystemTestRunner
3233from 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