Skip to content

Commit 1dcf669

Browse files
committed
dbms integtest now uses intended_dbdata_hardware
1 parent 395a6f8 commit 1dcf669

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

.github/workflows/tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
# Integration tests do require external systems to be running (most commonly a database instance).
5353
# Unlike end-to-end tests though, they test a specific module in a detailed manner, much like a unit test does.
5454
env:
55-
# We set `INTENDED_DBDATA_HARDWARE` so that it's seen when `integtest_pg_conn.py` executes `_set_up_gymlib_integtest_workspace.sh`.
55+
# The CI runs on ssd so we have to set this.
5656
INTENDED_DBDATA_HARDWARE: ssd
5757
run: |
5858
. "$HOME/.cargo/env"

dbms/postgres/cli.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,9 @@ def _postgres_dbdata(
171171
dbdata_parent_path
172172
), f"Intended hardware is SSD but dbdata_parent_path ({dbdata_parent_path}) is an HDD"
173173
else:
174-
assert False
174+
assert (
175+
False
176+
), f'Intended hardware is "{intended_dbdata_hardware}" which is invalid'
175177

176178
# Create dbdata
177179
_create_dbdata(

dbms/tests/integtest_dbms.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
import shutil
23
import unittest
34
from pathlib import Path
@@ -54,7 +55,10 @@ def test_postgres_dbdata(self) -> None:
5455
self.workspace.dbgym_workspace_path, "tpch", scale_factor
5556
)
5657
self.assertFalse(dbdata_tgz_path.exists())
57-
_postgres_dbdata(self.workspace, "tpch", scale_factor, None, "hdd", None)
58+
intended_dbdata_hardware = os.environ.get("INTENDED_DBDATA_HARDWARE", "hdd")
59+
_postgres_dbdata(
60+
self.workspace, "tpch", scale_factor, None, intended_dbdata_hardware, None
61+
)
5862
self.assertTrue(dbdata_tgz_path.exists())
5963
self.assertTrue(fully_resolve_path(dbdata_tgz_path).exists())
6064

0 commit comments

Comments
 (0)