Skip to content

Commit 39ea175

Browse files
authored
ref: Semaphore is now Relay (getsentry#589)
1 parent 3bf293e commit 39ea175

File tree

7 files changed

+27
-27
lines changed

7 files changed

+27
-27
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ venv
1919
.vscode/tags
2020
.pytest_cache
2121
.hypothesis
22-
semaphore
22+
relay
2323
pip-wheel-metadata
2424
.mypy_cache

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ install:
5454
- pip install tox
5555
- pip install codecov
5656
- make install-zeus-cli
57-
- bash scripts/download-semaphore.sh
57+
- bash scripts/download-relay.sh
5858

5959
script:
6060
- coverage erase

azure-pipelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
pip --version
6161
pip install tox
6262
pip install codecov
63-
sh scripts/download-semaphore.sh
63+
sh scripts/download-relay.sh
6464
displayName: "Install dependencies"
6565
6666
- script: |

scripts/download-semaphore.sh renamed to scripts/download-relay.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ if { [ "$TRAVIS" == "true" ] || [ "$TF_BUILD" == "True" ]; } && [ -z "$GITHUB_AP
66
exit 0;
77
fi
88

9-
target=semaphore
9+
target=relay
1010

11-
# Download the latest semaphore release for Travis
11+
# Download the latest relay release for Travis
1212

1313
output="$(
1414
curl -s \
15-
https://api.github.com/repos/getsentry/semaphore/releases/latest?access_token=$GITHUB_API_TOKEN
15+
https://api.github.com/repos/getsentry/relay/releases/latest?access_token=$GITHUB_API_TOKEN
1616
)"
1717

1818
echo "$output"

tests/conftest.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515

1616
from tests import _warning_recorder, _warning_recorder_mgr
1717

18-
SEMAPHORE = "./semaphore"
18+
SENTRY_RELAY = "./relay"
1919

20-
if not os.path.isfile(SEMAPHORE):
21-
SEMAPHORE = None
20+
if not os.path.isfile(SENTRY_RELAY):
21+
SENTRY_RELAY = None
2222

2323

2424
try:
@@ -117,7 +117,7 @@ def _capture_internal_warnings():
117117

118118

119119
@pytest.fixture
120-
def monkeypatch_test_transport(monkeypatch, semaphore_normalize):
120+
def monkeypatch_test_transport(monkeypatch, relay_normalize):
121121
def check_event(event):
122122
def check_string_keys(map):
123123
for key, value in iteritems(map):
@@ -127,16 +127,16 @@ def check_string_keys(map):
127127

128128
with capture_internal_exceptions():
129129
check_string_keys(event)
130-
semaphore_normalize(event)
130+
relay_normalize(event)
131131

132132
def inner(client):
133133
monkeypatch.setattr(client, "transport", TestTransport(check_event))
134134

135135
return inner
136136

137137

138-
def _no_errors_in_semaphore_response(obj):
139-
"""Assert that semaphore didn't throw any errors when processing the
138+
def _no_errors_in_relay_response(obj):
139+
"""Assert that relay didn't throw any errors when processing the
140140
event."""
141141

142142
def inner(obj):
@@ -156,9 +156,9 @@ def inner(obj):
156156

157157

158158
@pytest.fixture
159-
def semaphore_normalize(tmpdir):
159+
def relay_normalize(tmpdir):
160160
def inner(event):
161-
if not SEMAPHORE:
161+
if not SENTRY_RELAY:
162162
return
163163

164164
# Disable subprocess integration
@@ -169,10 +169,10 @@ def inner(event):
169169
with file.open() as f:
170170
output = json.loads(
171171
subprocess.check_output(
172-
[SEMAPHORE, "process-event"], stdin=f
172+
[SENTRY_RELAY, "process-event"], stdin=f
173173
).decode("utf-8")
174174
)
175-
_no_errors_in_semaphore_response(output)
175+
_no_errors_in_relay_response(output)
176176
output.pop("_meta", None)
177177
return output
178178

tests/integrations/aws_lambda/test_aws.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def lambda_client():
5555

5656

5757
@pytest.fixture(params=["python3.6", "python3.7", "python3.8", "python2.7"])
58-
def run_lambda_function(tmpdir, lambda_client, request, semaphore_normalize):
58+
def run_lambda_function(tmpdir, lambda_client, request, relay_normalize):
5959
def inner(code, payload):
6060
runtime = request.param
6161
tmpdir.ensure_dir("lambda_tmp").remove()
@@ -107,7 +107,7 @@ def delete_function():
107107
continue
108108
line = line[len(b"EVENT: ") :]
109109
events.append(json.loads(line.decode("utf-8")))
110-
semaphore_normalize(events[-1])
110+
relay_normalize(events[-1])
111111

112112
return events, response
113113

tests/test_serializer.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@
1818
)
1919
)
2020
@example(dt=datetime(2001, 1, 1, 0, 0, 0, 999500))
21-
def test_datetime_precision(dt, semaphore_normalize):
21+
def test_datetime_precision(dt, relay_normalize):
2222
event = serialize({"timestamp": dt})
23-
normalized = semaphore_normalize(event)
23+
normalized = relay_normalize(event)
2424

2525
if normalized is None:
26-
pytest.skip("no semaphore available")
26+
pytest.skip("no relay available")
2727

2828
dt2 = datetime.utcfromtimestamp(normalized["timestamp"])
2929

3030
# Float glitches can happen, and more glitches can happen
31-
# because we try to work around some float glitches in semaphore
31+
# because we try to work around some float glitches in relay
3232
assert (dt - dt2).total_seconds() < 1.0
3333

3434
@given(binary=st.binary(min_size=1))
@@ -43,13 +43,13 @@ def test_bytes_serialization_repr_many(binary, message_normalizer):
4343

4444

4545
@pytest.fixture
46-
def message_normalizer(semaphore_normalize):
47-
if semaphore_normalize({"test": "test"}) is None:
48-
pytest.skip("no semaphore available")
46+
def message_normalizer(relay_normalize):
47+
if relay_normalize({"test": "test"}) is None:
48+
pytest.skip("no relay available")
4949

5050
def inner(message, **kwargs):
5151
event = serialize({"logentry": {"message": message}}, **kwargs)
52-
normalized = semaphore_normalize(event)
52+
normalized = relay_normalize(event)
5353
return normalized["logentry"]["message"]
5454

5555
return inner

0 commit comments

Comments
 (0)