Skip to content

Commit

Permalink
ci: Generate Fluent journals
Browse files Browse the repository at this point in the history
  • Loading branch information
mkundu1 committed Nov 25, 2024
1 parent 6039511 commit f538639
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import os
from pathlib import Path
import shutil
import sys

from packaging.specifiers import SpecifierSet
from packaging.version import Version
Expand Down Expand Up @@ -92,7 +93,11 @@ def pytest_runtest_setup(item):

def pytest_collection_finish(session):
if session.config.getoption("--write-fluent-journals"):
fluent_test_root = Path(__file__).parent / "fluent"
import_path = Path(pyfluent.__file__).parent
sys.path.append(str(import_path))
import fluent_fixtures

fluent_test_root = import_path / "fluent"
shutil.rmtree(fluent_test_root, ignore_errors=True)
for item in session.items:
if item.module.__name__ == "test_settings_api":
Expand All @@ -114,6 +119,16 @@ def pytest_collection_finish(session):
fluent_test_file = fluent_test_dir / "test.py"
launcher_args = "3ddp"
parameters = inspect.signature(item.function).parameters
skip = False
for param in parameters:
if param not in dir(fluent_fixtures):
print(
f"Skipping {item.nodeid} because of missing fixture {param}"
)
skip = True
break
if skip:
continue
for param in parameters:
if param in launcher_args_by_fixture:
launcher_args = launcher_args_by_fixture[param]
Expand Down

0 comments on commit f538639

Please sign in to comment.