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 24
24
_TRIVUP_CLUSTER_TYPE_ENV = 'TEST_TRIVUP_CLUSTER_TYPE'
25
25
26
26
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'
30
30
31
- def use_group_protocol_consumer ():
32
- return _GROUP_PROTOCOL_ENV in os .environ and os .environ [_GROUP_PROTOCOL_ENV ] == 'consumer'
33
31
32
+ def _trivup_cluster_type_kraft ():
33
+ return _TRIVUP_CLUSTER_TYPE_ENV in os .environ and os .environ [_TRIVUP_CLUSTER_TYPE_ENV ] == 'kraft'
34
34
35
- def use_kraft ():
36
- return use_group_protocol_consumer () or _trivup_cluster_type_kraft ()
37
35
36
+ class TestUtils :
37
+ @staticmethod
38
+ def use_kraft ():
39
+ return TestUtils .use_group_protocol_consumer () or _trivup_cluster_type_kraft ()
38
40
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'
42
44
43
45
44
46
class TestConsumer (Consumer ):
Original file line number Diff line number Diff line change 17
17
#
18
18
19
19
import os
20
- from ..common import use_group_protocol_consumer , use_kraft
20
+ from ..common import TestUtils
21
21
import pytest
22
22
23
23
from tests .integration .cluster_fixture import TrivupFixture
29
29
def _broker_conf ():
30
30
broker_conf = ['transaction.state.log.replication.factor=1' ,
31
31
'transaction.state.log.min.isr=1' ]
32
- if use_group_protocol_consumer ():
32
+ if TestUtils . use_group_protocol_consumer ():
33
33
broker_conf .append ('group.coordinator.rebalance.protocols=classic,consumer' )
34
34
return broker_conf
35
35
@@ -38,7 +38,7 @@ def create_trivup_cluster(conf={}):
38
38
trivup_fixture_conf = {'with_sr' : True ,
39
39
'debug' : True ,
40
40
'cp_version' : '7.6.0' ,
41
- 'kraft' : use_kraft (),
41
+ 'kraft' : TestUtils . use_kraft (),
42
42
'version' : 'trunk' ,
43
43
'broker_conf' : _broker_conf ()}
44
44
trivup_fixture_conf .update (conf )
@@ -49,7 +49,7 @@ def create_sasl_cluster(conf={}):
49
49
trivup_fixture_conf = {'with_sr' : False ,
50
50
'version' : 'trunk' ,
51
51
'sasl_mechanism' : "PLAIN" ,
52
- 'kraft' : use_kraft (),
52
+ 'kraft' : TestUtils . use_kraft (),
53
53
'sasl_users' : 'sasl_user=sasl_user' ,
54
54
'debug' : True ,
55
55
'cp_version' : 'latest' ,
You can’t perform that action at this time.
0 commit comments