Skip to content

Commit

Permalink
tests: fix integration tests to use localhost
Browse files Browse the repository at this point in the history
  • Loading branch information
vkrizan committed Dec 20, 2024
1 parent 75d8f61 commit 7d31081
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tests/integration/event_source/test_insights_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def test_insights_source_sanity(run_rulebook, current_collection):
]

port = 5000
url = f"http://127.0.0.1:{port}/endpoint"
url = f"http://localhost:{port}/endpoint"

env = os.environ.copy()
env["ANSIBLE_COLLECTIONS_PATH"] = str(current_collection)
Expand Down Expand Up @@ -67,7 +67,7 @@ def test_insights_source_unauthorized(run_rulebook, current_collection):
of the Insights source plugin.
"""
port = 5000
url = f"http://127.0.0.1:{port}/endpoint"
url = f"http://localhost:{port}/endpoint"

env = os.environ.copy()
env["ANSIBLE_COLLECTIONS_PATH"] = str(current_collection)
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/event_source/test_insights.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ async def cancel_code(server_task):
async def test_cancel():
queue = asyncio.Queue()

args = {"host": "127.0.0.1", "port": 8001}
args = {"host": "localhost", "port": 8001}
plugin_task = asyncio.create_task(start_server(queue, args))
cancel_task = asyncio.create_task(cancel_code(plugin_task))

Expand All @@ -47,7 +47,7 @@ async def test_cancel():
async def test_post_endpoint(token, auth_header, request):
queue = asyncio.Queue()

args = {"host": "127.0.0.1", "port": 8000 + (hash(request.node.callspec.id) % 1000)}
args = {"host": "localhost", "port": 8000 + (hash(request.node.callspec.id) % 1000)}
if token:
args["token"] = token

Expand Down

0 comments on commit 7d31081

Please sign in to comment.