Skip to content

Commit f0b893c

Browse files
committed
Added extra logic when skipping database-related tests so that they genuinely raise errors if they fail in the GitHub Actions runners
1 parent f73835a commit f0b893c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tests/conftest.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,10 @@ def seed_ispyb_db(ispyb_db_session_factory):
252252
for name, id in ISPyBTableValues.experiment_types.items()
253253
]
254254
ispyb_db_session.close()
255-
# Skip ISPyB-related tests if the connection fails
256255
except InterfaceError:
256+
# If this fails in the GitHub test environment, raise it as a genuine error
257+
if os.getenv("GITHUB_ACTIONS") == "true":
258+
raise InterfaceError
257259
pytest.skip("ISPyB database has not been set up; skipping test")
258260

259261

@@ -299,6 +301,9 @@ def murfey_db_url():
299301
)
300302
# Skip Murfey database-related tests if the environment for it hasn't been set up
301303
except KeyError:
304+
# If this fails in the GitHub test environment, raise it as a genuine error
305+
if os.getenv("GITHUB_ACTIONS") == "true":
306+
raise KeyError
302307
pytest.skip("Murfey PostgreSQL database has not been set up; skipping test")
303308

304309

0 commit comments

Comments
 (0)