Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: test environment cannot connect to ES #71

Merged
merged 1 commit into from
Jul 10, 2024
Merged
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
13 changes: 10 additions & 3 deletions tests/test_elasticsearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,16 @@
from time_execution import settings
from time_execution.backends.elasticsearch import ElasticsearchBackend

# This variable is set by tox-docker. See https://tox-docker.readthedocs.io/en/latest/#configuration
ELASTICSEARCH_HOST = os.getenv("ELASTICSEARCH_HOST", "localhost")
ELASTICSEARCH_URI = f"http://{ELASTICSEARCH_HOST}:9200"
# These variables are set by tox-docker. See https://tox-docker.readthedocs.io/en/latest/#configuration
ELASTICSEARCH_HOST = os.getenv("ELASTICSEARCH_HOST")
if not ELASTICSEARCH_HOST:
raise RuntimeError("`ELASTICSEARCH_HOST` is not set")

ELASTICSEARCH_PORT = os.getenv("ELASTICSEARCH_9200_TCP_PORT")
if not ELASTICSEARCH_PORT:
raise RuntimeError("`ELASTICSEARCH_9200_TCP_PORT` is not set")

ELASTICSEARCH_URI = f"http://{ELASTICSEARCH_HOST}:{ELASTICSEARCH_PORT}"


class TestConnectionErrors(TestBaseBackend):
Expand Down
Loading