File tree Expand file tree Collapse file tree 2 files changed +16
-14
lines changed Expand file tree Collapse file tree 2 files changed +16
-14
lines changed Original file line number Diff line number Diff line change 2424_TRIVUP_CLUSTER_TYPE_ENV = 'TEST_TRIVUP_CLUSTER_TYPE'
2525
2626
27- def _trivup_cluster_type_kraft ( ):
28- return _TRIVUP_CLUSTER_TYPE_ENV in os . environ and os . environ [ _TRIVUP_CLUSTER_TYPE_ENV ] == 'kraft'
29-
27+ def _update_conf_group_protocol ( conf = None ):
28+ if conf is not None and 'group.id' in conf and TestUtils . use_group_protocol_consumer ():
29+ conf [ 'group.protocol' ] = 'consumer'
3030
31- def use_group_protocol_consumer ():
32- return _GROUP_PROTOCOL_ENV in os .environ and os .environ [_GROUP_PROTOCOL_ENV ] == 'consumer'
3331
32+ def _trivup_cluster_type_kraft ():
33+ return _TRIVUP_CLUSTER_TYPE_ENV in os .environ and os .environ [_TRIVUP_CLUSTER_TYPE_ENV ] == 'kraft'
3434
35- def use_kraft ():
36- return use_group_protocol_consumer () or _trivup_cluster_type_kraft ()
3735
36+ class TestUtils :
37+ @staticmethod
38+ def use_kraft ():
39+ return TestUtils .use_group_protocol_consumer () or _trivup_cluster_type_kraft ()
3840
39- def _update_conf_group_protocol ( conf = None ):
40- if conf is not None and 'group.id' in conf and use_group_protocol_consumer ():
41- conf [ 'group.protocol' ] = 'consumer'
41+ @ staticmethod
42+ def use_group_protocol_consumer ():
43+ return _GROUP_PROTOCOL_ENV in os . environ and os . environ [ _GROUP_PROTOCOL_ENV ] = = 'consumer'
4244
4345
4446class TestConsumer (Consumer ):
Original file line number Diff line number Diff line change 1717#
1818
1919import os
20- from ..common import use_group_protocol_consumer , use_kraft
20+ from ..common import TestUtils
2121import pytest
2222
2323from tests .integration .cluster_fixture import TrivupFixture
2929def _broker_conf ():
3030 broker_conf = ['transaction.state.log.replication.factor=1' ,
3131 'transaction.state.log.min.isr=1' ]
32- if use_group_protocol_consumer ():
32+ if TestUtils . use_group_protocol_consumer ():
3333 broker_conf .append ('group.coordinator.rebalance.protocols=classic,consumer' )
3434 return broker_conf
3535
@@ -38,7 +38,7 @@ def create_trivup_cluster(conf={}):
3838 trivup_fixture_conf = {'with_sr' : True ,
3939 'debug' : True ,
4040 'cp_version' : '7.6.0' ,
41- 'kraft' : use_kraft (),
41+ 'kraft' : TestUtils . use_kraft (),
4242 'version' : 'trunk' ,
4343 'broker_conf' : _broker_conf ()}
4444 trivup_fixture_conf .update (conf )
@@ -49,7 +49,7 @@ def create_sasl_cluster(conf={}):
4949 trivup_fixture_conf = {'with_sr' : False ,
5050 'version' : 'trunk' ,
5151 'sasl_mechanism' : "PLAIN" ,
52- 'kraft' : use_kraft (),
52+ 'kraft' : TestUtils . use_kraft (),
5353 'sasl_users' : 'sasl_user=sasl_user' ,
5454 'debug' : True ,
5555 'cp_version' : 'latest' ,
You can’t perform that action at this time.
0 commit comments