diff --git a/conftest.py b/conftest.py index b05956913c..0ef302b270 100644 --- a/conftest.py +++ b/conftest.py @@ -3,6 +3,7 @@ import operator import os import sys +import time from pathlib import Path import pytest @@ -113,6 +114,14 @@ def token(request): def pytest_configure(config): + junitxml_path = config.getoption("junitxml", None) + junitxml_global_dir = os.getenv("JUNITXML_DIR", None) + + if not junitxml_path and junitxml_global_dir: + timestamp = time.strftime("%Y%m%d%H%M%S") + os.makedirs(junitxml_global_dir, exist_ok=True) + config.option.xmlpath = os.path.join(junitxml_global_dir, f"result_{timestamp}.xml") + # Bitsandbytes installation for {test_bnb_qlora.py test_bnb_inference.py} tests # This change will be reverted shortly bnb_tests = any("bnb" in name for name in config.known_args_namespace.file_or_dir)