Skip to content

Commit df1aa2c

Browse files
committed
do it before upping
1 parent 984b6a8 commit df1aa2c

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

_integration-test/conftest.py

+21-21
Original file line numberDiff line numberDiff line change
@@ -17,29 +17,29 @@ def pytest_addoption(parser):
1717
parser.addoption("--customizations", default="disabled")
1818

1919

20-
def pytest_sessionstart(session):
21-
"""Back up the state of DB volumes"""
22-
result = subprocess.run(
23-
[
24-
"rsync",
25-
"-avWm",
26-
"--no-compress",
27-
"--mkpath",
28-
"/var/lib/docker/volumes/sentry-postgres",
29-
"/var/lib/docker/volumes/sentry-clickhouse",
30-
"/var/lib/docker/volumes/sentry-kafka",
31-
join(os.environ["RUNNER_TEMP"], "volumes", ""),
32-
],
33-
check=False,
34-
capture_output=True,
35-
)
36-
print(result.stdout.decode())
37-
print(result.stderr.decode())
38-
result.check_returncode()
39-
40-
4120
@pytest.fixture(scope="session", autouse=True)
4221
def configure_self_hosted_environment(request):
22+
"""Back up the state of DB volumes"""
23+
try:
24+
subprocess.run(
25+
[
26+
"rsync",
27+
"-avWm",
28+
"--no-compress",
29+
"--mkpath",
30+
"/var/lib/docker/volumes/sentry-postgres",
31+
"/var/lib/docker/volumes/sentry-clickhouse",
32+
"/var/lib/docker/volumes/sentry-kafka",
33+
join(os.environ["RUNNER_TEMP"], "volumes", ""),
34+
],
35+
check=True,
36+
capture_output=True,
37+
)
38+
except subprocess.CalledProcessError as e:
39+
print(e.stdout.decode())
40+
print(e.stderr.decode())
41+
raise e
42+
4343
subprocess.run(
4444
["docker", "compose", "--ansi", "never", "up", "--wait"],
4545
check=True,

0 commit comments

Comments
 (0)