Skip to content

Commit

Permalink
update tests and logging
Browse files Browse the repository at this point in the history
  • Loading branch information
mbthornton-lbl committed Nov 23, 2024
1 parent b5ced79 commit c457d75
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 3 additions & 1 deletion nmdc_automation/workflow_automation/sched.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ def cycle(self, dryrun: bool = False, skiplist: set = set(),
"""
This function does a single cycle of looking for new jobs
"""

logger.info("Starting cycle: polling for new jobs")
wfp_nodes = load_workflow_process_nodes(self.db, self.workflows, allowlist)

self.get_existing_jobs.cache_clear()
Expand All @@ -295,6 +295,8 @@ def cycle(self, dryrun: bool = False, skiplist: set = set(),
logging.debug(f"Skipping: {wfp_node.id}, workflow disabled.")
continue
jobs = self.find_new_jobs(wfp_node)
if jobs:
logging.info(f"Found {len(jobs)} new jobs for {wfp_node.id}")
for job in jobs:
if dryrun:
msg = f"new job: informed_by: {job.informed_by} trigger: {job.trigger_id} "
Expand Down
7 changes: 6 additions & 1 deletion tests/test_workflow_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
get_current_workflow_process_nodes,
load_workflow_process_nodes,
_resolve_relationships,
_map_nodes_to_data_objects
_map_nodes_to_data_objects,
_within_range
)
from nmdc_automation.workflow_automation.workflows import load_workflow_configs
from tests.fixtures.db_utils import load_fixture, reset_db
Expand Down Expand Up @@ -225,3 +226,7 @@ def test_get_required_data_objects_by_id(test_db, workflows_config_dir, workflow
# check that the expected data object types are present
for do_type in exp_do_types:
assert do_type in do_types

def test_within_range():
assert _within_range('v1.0.8', 'v1.0.8')
assert _within_range('v1.0.8', 'v1.0.9')

0 comments on commit c457d75

Please sign in to comment.