Skip to content

Commit c2c8b6b

Browse files
authored
integration tests upgrade (confluentinc#1401)
* fix .env with newer docker-compose * fix basic auth integration test * protoc test fix with newer Python and protobuf versions
1 parent 5749122 commit c2c8b6b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+454
-4359
lines changed

tests/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ The easiest way to arrange for this is:
6060

6161
And also:
6262

63-
source ./tests/docker/.env
63+
source ./tests/docker/.env.sh
6464

6565
which sets environment variables referenced by `./tests/integration/testconf.json`.
6666

File renamed without changes.

tests/docker/bin/certify.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set -eu
55
PY_DOCKER_BIN="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
66
export PASS="abcdefgh"
77

8-
source ${PY_DOCKER_BIN}/../.env
8+
source ${PY_DOCKER_BIN}/../.env.sh
99

1010
mkdir -p ${TLS}
1111

tests/docker/bin/cluster_down.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
set -eu
44

55
PY_DOCKER_BIN="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
6-
source ${PY_DOCKER_BIN}/../.env
6+
source ${PY_DOCKER_BIN}/../.env.sh
77

88
echo "Destroying cluster.."
99
docker-compose -f $PY_DOCKER_COMPOSE_FILE down -v --remove-orphans

tests/docker/bin/cluster_up.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
set -eu
44

55
PY_DOCKER_BIN="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
6-
source ${PY_DOCKER_BIN}/../.env
6+
source ${PY_DOCKER_BIN}/../.env.sh
77

88
# Wait for http service listener to come up and start serving
99
# $1 http service name
@@ -28,7 +28,7 @@ await_http() {
2828
}
2929

3030
echo "Configuring Environment..."
31-
source ${PY_DOCKER_SOURCE}/.env
31+
source ${PY_DOCKER_SOURCE}/.env.sh
3232

3333
echo "Generating SSL certs..."
3434
${PY_DOCKER_BIN}/certify.sh

tests/docker/docker-compose.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ services:
5252
volumes:
5353
- ./conf:/conf
5454
environment:
55-
SCHEMA_REGISTRY_HOST_NAME: schema-registry2
55+
SCHEMA_REGISTRY_HOST_NAME: schema-registry-basic-auth
5656
SCHEMA_REGISTRY_KAFKASTORE_TOPIC: _schemas2
57-
SCHEMA_REGISTRY_SCHEMA_REGISTRY_ZK_NAMESPACE: schema_registry2
57+
SCHEMA_REGISTRY_SCHEMA_REGISTRY_GROUP_ID: schema-registry-basic-auth
5858
SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS: PLAINTEXT://kafka:9092
5959
SCHEMA_REGISTRY_LISTENERS: http://0.0.0.0:8083, https://0.0.0.0:8084
6060
SCHEMA_REGISTRY_INTER_INSTANCE_PROTOCOL: https

tests/integration/integration_test.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import json
2929
import gc
3030
import struct
31+
import re
3132

3233
try:
3334
# Memory tracker
@@ -795,13 +796,17 @@ def verify_avro_basic_auth(mode_conf):
795796
if mode_conf is None:
796797
abort_on_missing_configuration('avro-basic-auth')
797798

798-
url = {
799-
'schema.registry.basic.auth.credentials.source': 'URL'
799+
url = mode_conf.get('schema.registry.url')
800+
credentials = mode_conf.get('schema.registry.basic.auth.user.info')
801+
802+
url_conf = {
803+
'schema.registry.basic.auth.credentials.source': 'URL',
804+
'schema.registry.url': str(re.sub("(^https?://)", f"\\1{credentials}@", url))
800805
}
801806

802807
user_info = {
803808
'schema.registry.basic.auth.credentials.source': 'USER_INFO',
804-
'schema.registry.basic.auth.user.info': mode_conf.get('schema.registry.basic.auth.user.info')
809+
'schema.registry.basic.auth.user.info': credentials
805810
}
806811

807812
sasl_inherit = {
@@ -813,7 +818,7 @@ def verify_avro_basic_auth(mode_conf):
813818
base_conf = {
814819
'bootstrap.servers': bootstrap_servers,
815820
'error_cb': error_cb,
816-
'schema.registry.url': schema_registry_url
821+
'schema.registry.url': url
817822
}
818823

819824
consumer_conf = dict({'group.id': generate_group_id(),
@@ -829,7 +834,7 @@ def verify_avro_basic_auth(mode_conf):
829834
run_avro_loop(dict(base_conf, **sasl_inherit), dict(consumer_conf, **sasl_inherit))
830835

831836
print('-' * 10, 'Verifying basic auth source URL', '-' * 10)
832-
run_avro_loop(dict(base_conf, **url), dict(consumer_conf, **url))
837+
run_avro_loop(dict(base_conf, **url_conf), dict(consumer_conf, **url_conf))
833838

834839

835840
def run_avro_loop(producer_conf, consumer_conf):

tests/integration/schema_registry/data/PublicTestProto.proto

Lines changed: 0 additions & 6 deletions
This file was deleted.

tests/integration/schema_registry/data/DependencyTestProto.proto renamed to tests/integration/schema_registry/data/proto/DependencyTestProto.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
syntax = "proto3";
22

3-
import "NestedTestProto.proto";
4-
import "PublicTestProto.proto";
3+
import "tests/integration/schema_registry/data/proto/NestedTestProto.proto";
4+
import "tests/integration/schema_registry/data/proto/PublicTestProto.proto";
55

66
package tests.integration.serialization.data;
77

tests/integration/schema_registry/data/proto/DependencyTestProto_pb2.py

Lines changed: 32 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy