Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -201,5 +201,7 @@ help:
@echo " PYTHON Python executable to use (default: \"$(PYTHON)\")."
@echo " PYTEST_ARGS Arguments to pass to pytest (unit tests)."
@echo " BEHAVE_ARGS Arguments to pass to behave (integration tests)."
@echo " Project-specific behave options:"
@echo " -D no_stop_on_fail Keep Docker containers running on test failure."
@echo " NO_VENV Disable creation of venv if the variable is set to non-empty value."
@echo " CLICKHOUSE_VERSION ClickHouse version to use in integration tests (default: \"$(CLICKHOUSE_VERSION)\")."
15 changes: 6 additions & 9 deletions tests/integration/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@
from tests.integration.modules.logs import save_logs
from tests.integration.modules.utils import version_ge, version_lt

try:
import ipdb as pdb
except ImportError:
import pdb # type: ignore


def before_all(context):
"""
Expand Down Expand Up @@ -50,16 +45,18 @@ def after_step(context, step):
"""
if step.status == "failed":
save_logs(context)
if context.config.userdata.getbool("debug"):
pdb.post_mortem(step.exc_traceback)


def after_all(context):
"""
Top-level cleanup function.
"""
if context.failed and not context.aborted:
logging.warning("Remember to run `make clean` after you done")
if (
context.failed
and not context.aborted
and context.config.userdata.getbool("no_stop_on_fail")
):
logging.info("Not stopping containers on failure as requested")
return
env_control.stop(context)

Expand Down