diff --git a/env/pg_conn.py b/env/pg_conn.py index 17b36499..db0278b4 100644 --- a/env/pg_conn.py +++ b/env/pg_conn.py @@ -346,7 +346,7 @@ def restart_with_changes( # Set up Boot if we're told to do so if self.boot_config_fpath is not None: - with open_and_save(self.dbgym_workspace, self.boot_config_fpath) as f: + with self.dbgym_workspace.open_and_save(self.boot_config_fpath) as f: boot_config = yaml.safe_load(f) self._set_up_boot( diff --git a/env/tests/_set_up_gymlib_integtest_workspace.sh b/env/tests/_set_up_gymlib_integtest_workspace.sh index b85e0fdf..b1538a70 100755 --- a/env/tests/_set_up_gymlib_integtest_workspace.sh +++ b/env/tests/_set_up_gymlib_integtest_workspace.sh @@ -11,7 +11,7 @@ # the Postgres repo is very large and (b) the built binary will be different for different machines. # This script should be run from the base dbgym/ directory. -set -euo pipefail +set -euxo pipefail # INTENDED_DBDATA_HARDWARE can be set elsewhere (e.g. by tests_ci.yaml) but we use hdd by default. INTENDED_DBDATA_HARDWARE="${INTENDED_DBDATA_HARDWARE:-hdd}" diff --git a/env/tests/integtest_workload.py b/env/tests/integtest_workload.py index a30f975b..cc9d6393 100644 --- a/env/tests/integtest_workload.py +++ b/env/tests/integtest_workload.py @@ -3,7 +3,6 @@ from benchmark.tpch.constants import DEFAULT_TPCH_SEED, NUM_TPCH_QUERIES from env.tests.gymlib_integtest_util import GymlibIntegtestManager from env.workload import Workload -from util.workspace import fully_resolve_path, get_default_workload_path class WorkloadTests(unittest.TestCase): diff --git a/env/workload.py b/env/workload.py index 89dde426..22a1c0fc 100644 --- a/env/workload.py +++ b/env/workload.py @@ -1,6 +1,6 @@ from pathlib import Path -from util.workspace import DBGymWorkspace, is_fully_resolved, open_and_save +from util.workspace import DBGymWorkspace, is_fully_resolved class Workload: @@ -15,13 +15,13 @@ def __init__(self, dbgym_workspace: DBGymWorkspace, workload_dpath: Path) -> Non assert order_fpath.exists() - with open_and_save(self.dbgym_workspace, order_fpath) as f: + with self.dbgym_workspace.open_and_save(order_fpath) as f: for line in f: qid, qpath = line.strip().split(",") qpath = Path(qpath) assert is_fully_resolved(qpath) - with open_and_save(self.dbgym_workspace, qpath) as qf: + with self.dbgym_workspace.open_and_save(qpath) as qf: self.queries[qid] = qf.read() self.query_order.append(qid) diff --git a/util/pg.py b/util/pg.py index 32f2fdee..a959e11b 100644 --- a/util/pg.py +++ b/util/pg.py @@ -28,7 +28,7 @@ def sqlalchemy_conn_execute( def sql_file_queries(dbgym_workspace: DBGymWorkspace, filepath: Path) -> list[str]: - with open_and_save(dbgym_workspace, filepath) as f: + with dbgym_workspace.open_and_save(filepath) as f: lines: list[str] = [] for line in f: if line.startswith("--"):