github.com/deanMdreon/kafka-go@v0.4.32/.circleci/config.yml (about) 1 version: 2 2 jobs: 3 # The kafka 0.10 tests are maintained as a separate configuration because 4 # kafka only supported plain text SASL in this version. 5 kafka-010: 6 working_directory: &working_directory /go/src/github.com/deanMdreon/kafka-go 7 environment: 8 KAFKA_VERSION: "0.10.1" 9 docker: 10 - image: circleci/golang 11 - image: wurstmeister/zookeeper 12 ports: 13 - 2181:2181 14 - image: wurstmeister/kafka:0.10.1.1 15 ports: 16 - 9092:9092 17 - 9093:9093 18 environment: 19 KAFKA_BROKER_ID: "1" 20 KAFKA_CREATE_TOPICS: "test-writer-0:3:1,test-writer-1:3:1" 21 KAFKA_DELETE_TOPIC_ENABLE: "true" 22 KAFKA_ADVERTISED_HOST_NAME: "localhost" 23 KAFKA_ADVERTISED_PORT: "9092" 24 KAFKA_ZOOKEEPER_CONNECT: "localhost:2181" 25 KAFKA_AUTO_CREATE_TOPICS_ENABLE: "true" 26 KAFKA_MESSAGE_MAX_BYTES: "200000000" 27 KAFKA_LISTENERS: "PLAINTEXT://:9092,SASL_PLAINTEXT://:9093" 28 KAFKA_ADVERTISED_LISTENERS: "PLAINTEXT://localhost:9092,SASL_PLAINTEXT://localhost:9093" 29 KAFKA_SASL_ENABLED_MECHANISMS: "PLAIN" 30 KAFKA_OPTS: "-Djava.security.auth.login.config=/opt/kafka/config/kafka_server_jaas.conf" 31 CUSTOM_INIT_SCRIPT: |- 32 echo -e 'KafkaServer {\norg.apache.kafka.common.security.plain.PlainLoginModule required\n username="adminplain"\n password="admin-secret"\n user_adminplain="admin-secret";\n };' > /opt/kafka/config/kafka_server_jaas.conf; 33 steps: &steps 34 - checkout 35 - restore_cache: 36 key: kafka-go-mod-{{ checksum "go.sum" }}-1 37 - run: 38 name: Download dependencies 39 command: go mod download 40 - save_cache: 41 key: kafka-go-mod-{{ checksum "go.sum" }}-1 42 paths: 43 - /go/pkg/mod 44 - run: 45 name: Test kafka-go 46 command: go test -race -cover ./... 47 - run: 48 name: Test kafka-go/sasl/aws_msk_iam 49 working_directory: ./sasl/aws_msk_iam 50 command: go test -race -cover ./... 51 52 # Starting at version 0.11, the kafka features and configuration remained 53 # mostly stable, so we can use this CI job configuration as template for other 54 # versions as well. 55 kafka-011: 56 working_directory: *working_directory 57 environment: 58 KAFKA_VERSION: "0.11.0" 59 docker: 60 - image: circleci/golang 61 - image: wurstmeister/zookeeper 62 ports: 63 - 2181:2181 64 - image: wurstmeister/kafka:2.11-0.11.0.3 65 ports: 66 - 9092:9092 67 - 9093:9093 68 environment: &environment 69 KAFKA_BROKER_ID: "1" 70 KAFKA_CREATE_TOPICS: "test-writer-0:3:1,test-writer-1:3:1" 71 KAFKA_DELETE_TOPIC_ENABLE: "true" 72 KAFKA_ADVERTISED_HOST_NAME: "localhost" 73 KAFKA_ADVERTISED_PORT: "9092" 74 KAFKA_ZOOKEEPER_CONNECT: "localhost:2181" 75 KAFKA_AUTO_CREATE_TOPICS_ENABLE: "true" 76 KAFKA_MESSAGE_MAX_BYTES: "200000000" 77 KAFKA_LISTENERS: "PLAINTEXT://:9092,SASL_PLAINTEXT://:9093" 78 KAFKA_ADVERTISED_LISTENERS: "PLAINTEXT://localhost:9092,SASL_PLAINTEXT://localhost:9093" 79 KAFKA_SASL_ENABLED_MECHANISMS: "PLAIN,SCRAM-SHA-256,SCRAM-SHA-512" 80 KAFKA_OPTS: "-Djava.security.auth.login.config=/opt/kafka/config/kafka_server_jaas.conf" 81 CUSTOM_INIT_SCRIPT: |- 82 apk add libgcc; 83 echo -e 'KafkaServer {\norg.apache.kafka.common.security.scram.ScramLoginModule required\n username="adminscram"\n password="admin-secret";\n org.apache.kafka.common.security.plain.PlainLoginModule required\n username="adminplain"\n password="admin-secret"\n user_adminplain="admin-secret";\n };' > /opt/kafka/config/kafka_server_jaas.conf; 84 /opt/kafka/bin/kafka-configs.sh --zookeeper localhost:2181 --alter --add-config 'SCRAM-SHA-256=[password=admin-secret-256],SCRAM-SHA-512=[password=admin-secret-512]' --entity-type users --entity-name adminscram 85 steps: *steps 86 87 kafka-101: 88 working_directory: *working_directory 89 environment: 90 KAFKA_VERSION: "1.0.1" 91 docker: 92 - image: circleci/golang 93 - image: wurstmeister/zookeeper 94 ports: 95 - 2181:2181 96 - image: wurstmeister/kafka:2.11-1.0.1 97 ports: 98 - 9092:9092 99 - 9093:9093 100 environment: *environment 101 steps: *steps 102 103 kafka-111: 104 working_directory: *working_directory 105 environment: 106 KAFKA_VERSION: "1.1.1" 107 docker: 108 - image: circleci/golang 109 - image: wurstmeister/zookeeper 110 ports: 111 - 2181:2181 112 - image: wurstmeister/kafka:2.11-1.1.1 113 ports: 114 - 9092:9092 115 - 9093:9093 116 environment: *environment 117 steps: *steps 118 119 kafka-201: 120 working_directory: *working_directory 121 environment: 122 KAFKA_VERSION: "2.0.1" 123 docker: 124 - image: circleci/golang 125 - image: wurstmeister/zookeeper 126 ports: 127 - 2181:2181 128 - image: wurstmeister/kafka:2.12-2.0.1 129 ports: 130 - 9092:9092 131 - 9093:9093 132 environment: 133 <<: *environment 134 KAFKA_AUTHORIZER_CLASS_NAME: "kafka.security.auth.SimpleAclAuthorizer" 135 KAFKA_ALLOW_EVERYONE_IF_NO_ACL_FOUND: "true" 136 steps: *steps 137 138 kafka-211: 139 working_directory: *working_directory 140 environment: 141 KAFKA_VERSION: "2.1.1" 142 docker: 143 - image: circleci/golang 144 - image: wurstmeister/zookeeper 145 ports: 146 - 2181:2181 147 - image: wurstmeister/kafka:2.12-2.1.1 148 ports: 149 - 9092:9092 150 - 9093:9093 151 environment: 152 <<: *environment 153 KAFKA_AUTHORIZER_CLASS_NAME: "kafka.security.auth.SimpleAclAuthorizer" 154 KAFKA_ALLOW_EVERYONE_IF_NO_ACL_FOUND: "true" 155 steps: *steps 156 157 kafka-222: 158 working_directory: *working_directory 159 environment: 160 KAFKA_VERSION: "2.2.2" 161 docker: 162 - image: circleci/golang 163 - image: wurstmeister/zookeeper 164 ports: 165 - 2181:2181 166 - image: wurstmeister/kafka:2.12-2.2.2 167 ports: 168 - 9092:9092 169 - 9093:9093 170 environment: 171 <<: *environment 172 KAFKA_AUTHORIZER_CLASS_NAME: "kafka.security.auth.SimpleAclAuthorizer" 173 KAFKA_ALLOW_EVERYONE_IF_NO_ACL_FOUND: "true" 174 steps: *steps 175 176 kafka-231: 177 working_directory: *working_directory 178 environment: 179 KAFKA_VERSION: "2.3.1" 180 docker: 181 - image: circleci/golang 182 - image: wurstmeister/zookeeper 183 ports: 184 - 2181:2181 185 - image: wurstmeister/kafka:2.12-2.3.1 186 ports: 187 - 9092:9092 188 - 9093:9093 189 environment: 190 <<: *environment 191 KAFKA_AUTHORIZER_CLASS_NAME: "kafka.security.auth.SimpleAclAuthorizer" 192 KAFKA_ALLOW_EVERYONE_IF_NO_ACL_FOUND: "true" 193 steps: *steps 194 195 kafka-241: 196 working_directory: *working_directory 197 environment: 198 KAFKA_VERSION: "2.4.1" 199 200 # Need to skip nettest to avoid these kinds of errors: 201 # --- FAIL: TestConn/nettest (17.56s) 202 # --- FAIL: TestConn/nettest/PingPong (7.40s) 203 # conntest.go:112: unexpected Read error: [7] Request Timed Out: the request exceeded the user-specified time limit in the request 204 # conntest.go:118: mismatching value: got 77, want 78 205 # conntest.go:118: mismatching value: got 78, want 79 206 # ... 207 # 208 # TODO: Figure out why these are happening and fix them (they don't appear to be new). 209 KAFKA_SKIP_NETTEST: "1" 210 docker: 211 - image: circleci/golang 212 - image: wurstmeister/zookeeper 213 ports: 214 - 2181:2181 215 - image: wurstmeister/kafka:2.12-2.4.1 216 ports: 217 - 9092:9092 218 - 9093:9093 219 environment: 220 <<: *environment 221 KAFKA_AUTHORIZER_CLASS_NAME: "kafka.security.authorizer.AclAuthorizer" 222 KAFKA_ALLOW_EVERYONE_IF_NO_ACL_FOUND: "true" 223 steps: *steps 224 225 kafka-260: 226 working_directory: *working_directory 227 environment: 228 KAFKA_VERSION: "2.6.0" 229 230 # Need to skip nettest to avoid these kinds of errors: 231 # --- FAIL: TestConn/nettest (17.56s) 232 # --- FAIL: TestConn/nettest/PingPong (7.40s) 233 # conntest.go:112: unexpected Read error: [7] Request Timed Out: the request exceeded the user-specified time limit in the request 234 # conntest.go:118: mismatching value: got 77, want 78 235 # conntest.go:118: mismatching value: got 78, want 79 236 # ... 237 # 238 # TODO: Figure out why these are happening and fix them (they don't appear to be new). 239 KAFKA_SKIP_NETTEST: "1" 240 docker: 241 - image: circleci/golang 242 - image: wurstmeister/zookeeper 243 ports: 244 - 2181:2181 245 - image: wurstmeister/kafka:2.13-2.6.0 246 ports: 247 - 9092:9092 248 - 9093:9093 249 environment: 250 <<: *environment 251 KAFKA_AUTHORIZER_CLASS_NAME: "kafka.security.authorizer.AclAuthorizer" 252 KAFKA_ALLOW_EVERYONE_IF_NO_ACL_FOUND: "true" 253 steps: *steps 254 255 kafka-271: 256 working_directory: *working_directory 257 environment: 258 KAFKA_VERSION: "2.7.1" 259 260 # Need to skip nettest to avoid these kinds of errors: 261 # --- FAIL: TestConn/nettest (17.56s) 262 # --- FAIL: TestConn/nettest/PingPong (7.40s) 263 # conntest.go:112: unexpected Read error: [7] Request Timed Out: the request exceeded the user-specified time limit in the request 264 # conntest.go:118: mismatching value: got 77, want 78 265 # conntest.go:118: mismatching value: got 78, want 79 266 # ... 267 # 268 # TODO: Figure out why these are happening and fix them (they don't appear to be new). 269 KAFKA_SKIP_NETTEST: "1" 270 docker: 271 - image: circleci/golang 272 - image: wurstmeister/zookeeper 273 ports: 274 - 2181:2181 275 - image: wurstmeister/kafka:2.13-2.7.1 276 ports: 277 - 9092:9092 278 - 9093:9093 279 environment: 280 <<: *environment 281 KAFKA_AUTHORIZER_CLASS_NAME: "kafka.security.authorizer.AclAuthorizer" 282 KAFKA_ALLOW_EVERYONE_IF_NO_ACL_FOUND: "true" 283 steps: *steps 284 285 workflows: 286 version: 2 287 run: 288 jobs: 289 - kafka-010 290 - kafka-011 291 - kafka-101 292 - kafka-111 293 - kafka-201 294 - kafka-211 295 - kafka-222 296 - kafka-231 297 - kafka-241 298 - kafka-260 299 - kafka-271