From a549843f74663907689c48c98fc3d919d58850a5 Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 15 Dec 2023 15:09:13 +0100 Subject: [PATCH] wip run full integration from tmp recipes dir --- tests/test_cli_full_integration.py | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/tests/test_cli_full_integration.py b/tests/test_cli_full_integration.py index e2d8520..a497055 100644 --- a/tests/test_cli_full_integration.py +++ b/tests/test_cli_full_integration.py @@ -1,3 +1,4 @@ +import shutil import subprocess from pathlib import Path @@ -8,12 +9,20 @@ from pytest_abra.utils import load_json_to_environ @pytest.fixture(scope="session") -def session_tmp_path_testout(tmp_path_factory: pytest.TempPathFactory) -> Path: - return tmp_path_factory.mktemp("test_out") +def tmp_recipes(tmp_path_factory: pytest.TempPathFactory) -> Path: + tmp_recipes_target = tmp_path_factory.mktemp("recipes") + recipes_dir_source = Path("recipes") + shutil.copytree(recipes_dir_source, tmp_recipes_target, dirs_exist_ok=True) + return tmp_recipes_target + + +@pytest.fixture(scope="session") +def tmp_output(tmp_path_factory: pytest.TempPathFactory) -> Path: + return tmp_path_factory.mktemp("output") @pytest.mark.slow -def test_abratest_cli_full_integration(session_tmp_path_testout: Path): +def test_abratest_cli_full_integration(tmp_output: Path, tmp_recipes: Path): """run abratest against the dev instance""" # --------------------- load credentials to env variables -------------------- # @@ -33,9 +42,8 @@ def test_abratest_cli_full_integration(session_tmp_path_testout: Path): # ----------------------------------- dirs ----------------------------------- # - RECIPES_DIR = Path("./recipes").resolve() - # OUTPUT_DIR = Path("./test-output").resolve() - OUTPUT_DIR = session_tmp_path_testout.resolve() + RECIPES_DIR = tmp_recipes.resolve() + OUTPUT_DIR = tmp_output.resolve() # ------------------------------------ run ----------------------------------- # @@ -57,8 +65,8 @@ def test_abratest_cli_full_integration(session_tmp_path_testout: Path): @pytest.mark.slow -def test_results_abra(session_tmp_path_testout: Path): - OUTPUT_DIR = session_tmp_path_testout.resolve() +def test_results_abra(tmp_output: Path): + OUTPUT_DIR = tmp_output.resolve() DIR = DirManager(output_dir=OUTPUT_DIR, session_id="abc") all_files = [f.name for f in DIR.STATUS.rglob("*")]