Skip to content

Commit 9e50281

Browse files
committed
bake in customizations to avoid duplicate installs
1 parent 93a1e07 commit 9e50281

File tree

3 files changed

+12
-29
lines changed

3 files changed

+12
-29
lines changed

.github/workflows/test.yml

+11-1
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,16 @@ jobs:
212212
run: |
213213
# This is for the cache restore on Kafka to work in older releases
214214
docker run --rm -v "sentry-kafka:/data" busybox chown -R 1000:1000 /data
215+
# Add some customizations to test that path
216+
cat <<EOT >> sentry/enhance-image.sh
217+
#!/bin/bash
218+
touch /created-by-enhance-image
219+
apt-get update
220+
apt-get install -y gcc libsasl2-dev python-dev-is-python3 libldap2-dev libssl-dev
221+
EOT
222+
chmod 755 sentry/enhance-image.sh
223+
echo "python-ldap" > sentry/requirements.txt
224+
215225
./install.sh
216226
217227
- name: Prepare Docker Volume Caching
@@ -242,7 +252,7 @@ jobs:
242252
/var/lib/docker/volumes/sentry-kafka \
243253
"$RUNNER_TEMP/volumes/"
244254
docker compose up --wait
245-
pytest --cov --junitxml=junit.xml _integration-test/ --customizations=enabled
255+
pytest --cov --junitxml=junit.xml _integration-test/
246256
247257
- name: Inspect failure
248258
if: failure()

_integration-test/conftest.py

-24
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@
1212
TEST_PASS = "test123TEST"
1313
TIMEOUT_SECONDS = 60
1414

15-
16-
def pytest_addoption(parser):
17-
parser.addoption("--customizations", default="disabled")
18-
19-
2015
@pytest.fixture(scope="session", autouse=True)
2116
def configure_self_hosted_environment(request):
2217
subprocess.run(
@@ -35,25 +30,6 @@ def configure_self_hosted_environment(request):
3530
else:
3631
raise AssertionError("timeout waiting for self-hosted to come up")
3732

38-
if request.config.getoption("--customizations") == "enabled":
39-
os.environ["TEST_CUSTOMIZATIONS"] = "enabled"
40-
script_content = """\
41-
#!/bin/bash
42-
touch /created-by-enhance-image
43-
apt-get update
44-
apt-get install -y gcc libsasl2-dev python-dev-is-python3 libldap2-dev libssl-dev
45-
"""
46-
47-
with open("sentry/enhance-image.sh", "w") as script_file:
48-
script_file.write(script_content)
49-
# Set executable permissions for the shell script
50-
os.chmod("sentry/enhance-image.sh", 0o755)
51-
52-
# Write content to the requirements.txt file
53-
with open("sentry/requirements.txt", "w") as req_file:
54-
req_file.write("python-ldap\n")
55-
os.environ["MINIMIZE_DOWNTIME"] = "1"
56-
subprocess.run(["./install.sh"], check=True, capture_output=True)
5733
# Create test user
5834
subprocess.run(
5935
[

_integration-test/test_run.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,4 @@ def test_customizations():
456456
]
457457
for command in commands:
458458
result = subprocess.run(command, check=False)
459-
if os.getenv("TEST_CUSTOMIZATIONS", "disabled") == "enabled":
460-
assert result.returncode == 0
461-
else:
462-
assert result.returncode != 0
459+
assert result.returncode == 0

0 commit comments

Comments
 (0)