Skip to content

Commit

Permalink
chore(requests): fix local test runs
Browse files Browse the repository at this point in the history
update docker-compose to match gitlab restrictions
  • Loading branch information
mabdinur committed Sep 24, 2024
1 parent cf6f007 commit b0a2f1a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ services:
- "${TMPDIR:-/var/lib/localstack}:/var/lib/localstack"
- "/var/run/docker.sock:/var/run/docker.sock"

httpbin_local:
httpbin-local:
image: kennethreitz/httpbin@sha256:2c7abc4803080c22928265744410173b6fea3b898872c01c5fd0f0f9df4a59fb
platform: linux/amd64
ports:
Expand Down
10 changes: 6 additions & 4 deletions tests/contrib/requests/test_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from tests.utils import override_global_tracer


HOST_AND_PORT = "httpbin-local:8001"
HOST_AND_PORT = "localhost:8001"
SOCKET = HOST_AND_PORT.split(":")[0]
URL_200 = "http://{}/status/200".format(HOST_AND_PORT)
URL_500 = "http://{}/status/500".format(HOST_AND_PORT)
Expand Down Expand Up @@ -243,9 +243,11 @@ def test_non_existant_url(self):
assert s.get_tag("span.kind") == "client"
assert s.get_tag("out.host") == "doesnotexist.google.com"
assert s.error == 1
assert "Name or service not known" in s.get_tag(ERROR_MSG)
assert "Name or service not known" in s.get_tag(ERROR_STACK)
assert "Traceback (most recent call last)" in s.get_tag(ERROR_STACK)
assert (
"HTTPConnectionPool(host='doesnotexist.google.com', port=80): Max retries exceeded with url: /"
in s.get_tag(ERROR_MSG)
)
assert s.get_tag(ERROR_STACK)
assert "requests.exception" in s.get_tag(ERROR_TYPE)

def test_500(self):
Expand Down

0 comments on commit b0a2f1a

Please sign in to comment.