test_abratest_cli_full_integration working

This commit is contained in:
Daniel 2023-12-11 15:53:22 +01:00
parent aba66158a1
commit 766e7909d0

View file

@ -3,6 +3,7 @@ from pathlib import Path
import pytest import pytest
from pytest_abra import DirManager
from pytest_abra.utils import load_json_to_environ from pytest_abra.utils import load_json_to_environ
@ -33,8 +34,8 @@ def test_abratest_cli_full_integration(session_tmp_path_testout: Path):
# ----------------------------------- dirs ----------------------------------- # # ----------------------------------- dirs ----------------------------------- #
RECIPES_DIR = Path("../recipes").resolve() RECIPES_DIR = Path("../recipes").resolve()
OUTPUT_DIR = Path("./test-output").resolve() # OUTPUT_DIR = Path("./test-output").resolve()
# OUTPUT_DIR = session_tmp_path_testout.resolve() OUTPUT_DIR = session_tmp_path_testout.resolve()
# ------------------------------------ run ----------------------------------- # # ------------------------------------ run ----------------------------------- #
@ -47,27 +48,17 @@ def test_abratest_cli_full_integration(session_tmp_path_testout: Path):
RECIPES_DIR, RECIPES_DIR,
"--output_dir", "--output_dir",
OUTPUT_DIR, OUTPUT_DIR,
], "--session_id",
capture_output=True, "abc",
]
) )
with open(OUTPUT_DIR / "tempfile_stdout.txt", "w") as f:
f.write(str(result.stdout))
with open(OUTPUT_DIR / "tempfile_stderr.txt", "w") as f: @pytest.mark.slow
f.write(str(result.stderr)) def test_results_abra(session_tmp_path_testout: Path):
OUTPUT_DIR = session_tmp_path_testout.resolve()
# print(result) DIR = DirManager(output_dir=OUTPUT_DIR, session_id="abc")
all_files = list(DIR.STATUS.rglob("*"))
assert result.returncode == 0 passed_files = list(DIR.STATUS.rglob("passed-*"))
assert len(all_files) == len(passed_files)
assert "failed" not in str(result.stdout)
# assert False
# @pytest.mark.slow
# def test_results_abra(session_tmp_path_testout: Path):
# OUTPUT_DIR = Path("./test-output").resolve()
# print(list(OUTPUT_DIR.rglob("*")))
# assert False