@@ -17,29 +17,29 @@ def pytest_addoption(parser):
17
17
parser .addoption ("--customizations" , default = "disabled" )
18
18
19
19
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
-
41
20
@pytest .fixture (scope = "session" , autouse = True )
42
21
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
+
43
43
subprocess .run (
44
44
["docker" , "compose" , "--ansi" , "never" , "up" , "--wait" ],
45
45
check = True ,
0 commit comments