Skip to content

Commit

Permalink
feat: e2e tests within docker
Browse files Browse the repository at this point in the history
- we split out e2e tests into own folder

- e2e tests will run against the service in docker compose

- we start by splitting out the prometheus and kafka e2e tests which do not need local running services
  • Loading branch information
nosahama committed Nov 27, 2024
1 parent 9155fdb commit 199e5f8
Show file tree
Hide file tree
Showing 25 changed files with 560 additions and 59 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
__pycache__/
/build/
/dist/
/karapace.egg-info/
src/karapace.egg-info/
/karapace-rpm-src.tar
/kafka_*.tgz
/kafka_*/
venv
/karapace/version.py
src/karapace/version.py
.run
.python-version
.hypothesis/
Expand Down
8 changes: 8 additions & 0 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,11 @@ unit-tests-in-docker:
rm -fr runtime/*
$(KARAPACE-CLI) $(PYTHON) -m pytest -s -vvv $(PYTEST_ARGS) tests/unit/
rm -fr runtime/*

.PHONY: e2e-tests-in-docker
e2e-tests-in-docker: export PYTEST_ARGS ?=
e2e-tests-in-docker:
rm -fr runtime/*
sleep 10
$(KARAPACE-CLI) $(PYTHON) -m pytest -s -vvv $(PYTEST_ARGS) tests/e2e/
rm -fr runtime/*
3 changes: 3 additions & 0 deletions container/karapace.registry.env
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,6 @@ STATSD_PORT=8125
KAFKA_SCHEMA_READER_STRICT_MODE=False
KAFKA_RETRIABLE_ERRORS_SILENCED=True
USE_PROTOBUF_FORMATTER=False
HTTP_REQUEST_MAX_SIZE=1048576
REST_BASE_URI=http://karapace-rest-proxy:8082
TAGS='{ "app": "karapace-schema-registry" }'
1 change: 1 addition & 0 deletions container/karapace.rest.env
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,5 @@ KAFKA_SCHEMA_READER_STRICT_MODE=False
KAFKA_RETRIABLE_ERRORS_SILENCED=True
USE_PROTOBUF_FORMATTER=False
HTTP_REQUEST_MAX_SIZE=1048576
REST_BASE_URI=http://karapace-rest-proxy:8082
TAGS='{ "app": "karapace-rest-proxy" }'
10 changes: 7 additions & 3 deletions karapace.config.env
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
ACCESS_LOGS_DEBUG=False
ACCESS_LOG_CLASS=aiohttp.web_log.AccessLogger
ADVERTISED_HOSTNAME=127.0.0.1
ADVERTISED_PORT=8081
ADVERTISED_PROTOCOL=http
BOOTSTRAP_URI=127.0.0.1:9092
BOOTSTRAP_URI=kafka:29092
CLIENT_ID=sr-1
COMPATIBILITY=BACKWARD
CONNECTIONS_MAX_IDLE_MS=15000
Expand All @@ -14,7 +15,7 @@ FETCH_MIN_BYTES=1
GROUP_ID=group_id8357e932
HOST=127.0.0.1
PORT=8081
REGISTRY_HOST=127.0.0.1
REGISTRY_HOST=karapace-schema-registry
REGISTRY_PORT=8081
REST_AUTHORIZATION=False
LOG_HANDLER=stdout
Expand All @@ -38,8 +39,11 @@ NAME_STRATEGY=topic_name
NAME_STRATEGY_VALIDATION=True
MASTER_ELECTION_STRATEGY=lowest
PROTOBUF_RUNTIME_DIRECTORY=runtime
STATSD_HOST=127.0.0.1
STATSD_HOST=statsd-exporter
STATSD_PORT=8125
KAFKA_SCHEMA_READER_STRICT_MODE=False
KAFKA_RETRIABLE_ERRORS_SILENCED=True
USE_PROTOBUF_FORMATTER=False
REST_BASE_URI=http://karapace-rest-proxy:8082
HTTP_REQUEST_MAX_SIZE=1048576
TAGS='{ "app": "karapace" }'
2 changes: 1 addition & 1 deletion mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ warn_no_return = True
warn_unreachable = True
strict_equality = True

[mypy-karapace.schema_registry_apis]
[mypy-schema_registry.schema_registry_apis]
ignore_errors = True

[mypy-karapace.compatibility.jsonschema.checks]
Expand Down
10 changes: 10 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ dependencies = [
"zstandard",
"prometheus-client == 0.20.0",
"yarl == 1.12.1",
"opentelemetry-api == 1.28.2",
"opentelemetry-sdk == 1.28.2",
"opentelemetry-instrumentation-fastapi == 0.49b2",
"dependency-injector == 4.43.0",

# Patched dependencies
#
Expand Down Expand Up @@ -105,6 +109,12 @@ typing = [
[tool.setuptools]
include-package-data = true

[tool.setuptools.packages.find]
where = ["src"]

[tool.setuptools.package-data]
karapace = ["*.yaml"]

[tool.setuptools_scm]
version_file = "src/karapace/version.py"

Expand Down
Loading

0 comments on commit 199e5f8

Please sign in to comment.