From 1c7ba5561de3272fbb243a315c6168d964c244c9 Mon Sep 17 00:00:00 2001 From: Paul Yang Date: Wed, 26 Jul 2023 16:41:35 -0700 Subject: [PATCH] Update generate snapshot script with new test setup. --- metricflow/test/generate_snapshots.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/metricflow/test/generate_snapshots.py b/metricflow/test/generate_snapshots.py index 645e66b5e4..4eda3e2bc3 100644 --- a/metricflow/test/generate_snapshots.py +++ b/metricflow/test/generate_snapshots.py @@ -146,7 +146,13 @@ def run_tests(test_configuration: MetricFlowTestConfiguration, test_file_paths: or test_configuration.engine is SqlEngine.DATABRICKS or test_configuration.engine is SqlEngine.POSTGRES ): - run_command(f"pytest -x -vv -n 4 --overwrite-snapshots --use-persistent-source-schema {combined_paths}") + engine_name = test_configuration.engine.value.lower() + os.environ["MF_TEST_ADAPTER_TYPE"] = engine_name + hatch_env = f"{engine_name}-env" + run_command( + f"hatch -v run {hatch_env}:pytest -x -vv -n 4 " + f"--overwrite-snapshots --use-persistent-source-schema {combined_paths}" + ) else: assert_values_exhausted(test_configuration.engine)