cleanup #18
1 changed files with 16 additions and 8 deletions
|
|
@ -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("*")]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue