Skip to content

Commit

Permalink
chore: sync project template
Browse files Browse the repository at this point in the history
  • Loading branch information
makkus committed Apr 17, 2024
1 parent ca734f9 commit ebf04c3
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .cruft.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"template": "https://github.com/DHARPA-Project/kiara_plugin.develop.git",
"commit": "ece102a4be81cb7d082dc549e3524c230afa6644",
"commit": "61841496d46e8ce4f79da1126443524bde03f977",
"checkout": null,
"context": {
"cookiecutter": {
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ classifiers = [
"Programming Language :: Python :: 3.12"
]
dependencies = [
"kiara>=0.5.9,<0.6.0",
"kiara>=0.5.10rc10,<0.6.0",
"kiara_plugin.core_types>=0.5.0,<0.6.0",
"httpx>=0.23.0",
"pyzenodo3>=1.0.2",
Expand Down
27 changes: 18 additions & 9 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@
from kiara.utils.testing import get_init_job, get_tests_for_job, list_job_descs

ROOT_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
JOBS_FOLDER = Path(os.path.join(ROOT_DIR, "examples", "jobs"))
JOBS_FOLDERS = [
Path(os.path.join(ROOT_DIR, "tests", "resources", "jobs")),
Path(os.path.join(ROOT_DIR, "examples", "jobs")),
]


def create_temp_dir():
Expand Down Expand Up @@ -55,22 +58,28 @@ def kiara_api_init_example() -> KiaraAPI:
kc = KiaraConfig.create_in_folder(instance_path)
api = KiaraAPI(kc)

init_job = get_init_job(JOBS_FOLDER)
if init_job is None:
init_jobs = []
for jobs_folder in JOBS_FOLDERS:
init_job = get_init_job(jobs_folder)
if init_job is not None:
init_jobs.append(init_job)

if not init_jobs:
return api

results = api.run_job(init_job)
for init_job in init_jobs:
results = api.run_job(init_job, comment="Init example job")

if not init_job.save:
return api
if not init_job.save:
continue

for field_name, alias_name in init_job.save.items():
api.store_value(results[field_name], alias_name)
for field_name, alias_name in init_job.save.items():
api.store_value(results[field_name], alias_name)

return api


@pytest.fixture(params=list_job_descs(JOBS_FOLDER), ids=get_job_alias)
@pytest.fixture(params=list_job_descs(JOBS_FOLDERS), ids=get_job_alias)
def example_job_test(request, kiara_api_init_example) -> JobTest:

job_tests_folder = Path(os.path.join(ROOT_DIR, "tests", "job_tests"))
Expand Down
Empty file added tests/resources/jobs/.gitkeep
Empty file.
Empty file.

0 comments on commit ebf04c3

Please sign in to comment.