Skip to content

Commit

Permalink
dbms integtest now uses intended_dbdata_hardware
Browse files Browse the repository at this point in the history
  • Loading branch information
wangpatrick57 committed Dec 30, 2024
1 parent 395a6f8 commit 1dcf669
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
# Integration tests do require external systems to be running (most commonly a database instance).
# Unlike end-to-end tests though, they test a specific module in a detailed manner, much like a unit test does.
env:
# We set `INTENDED_DBDATA_HARDWARE` so that it's seen when `integtest_pg_conn.py` executes `_set_up_gymlib_integtest_workspace.sh`.
# The CI runs on ssd so we have to set this.
INTENDED_DBDATA_HARDWARE: ssd
run: |
. "$HOME/.cargo/env"
Expand Down
4 changes: 3 additions & 1 deletion dbms/postgres/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,9 @@ def _postgres_dbdata(
dbdata_parent_path
), f"Intended hardware is SSD but dbdata_parent_path ({dbdata_parent_path}) is an HDD"
else:
assert False
assert (
False
), f'Intended hardware is "{intended_dbdata_hardware}" which is invalid'

# Create dbdata
_create_dbdata(
Expand Down
6 changes: 5 additions & 1 deletion dbms/tests/integtest_dbms.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import shutil
import unittest
from pathlib import Path
Expand Down Expand Up @@ -54,7 +55,10 @@ def test_postgres_dbdata(self) -> None:
self.workspace.dbgym_workspace_path, "tpch", scale_factor
)
self.assertFalse(dbdata_tgz_path.exists())
_postgres_dbdata(self.workspace, "tpch", scale_factor, None, "hdd", None)
intended_dbdata_hardware = os.environ.get("INTENDED_DBDATA_HARDWARE", "hdd")
_postgres_dbdata(
self.workspace, "tpch", scale_factor, None, intended_dbdata_hardware, None
)
self.assertTrue(dbdata_tgz_path.exists())
self.assertTrue(fully_resolve_path(dbdata_tgz_path).exists())

Expand Down

0 comments on commit 1dcf669

Please sign in to comment.