Exemplo n.º 1
0
    def reset_job_manager(self):
        # all jobs have been removed from the JobManager
        self.jm._running_jobs = {}
        self.jm._jobs_by_cell_id = {}
        self.jm = JobManager()

        self.assertEqual(self.jm._running_jobs, {})
        self.assertEqual(self.jm._jobs_by_cell_id, {})
Exemplo n.º 2
0
 def __init__(self):
     if self._comm is None:
         self._comm = Comm(target_name="KBaseJobs", data={})
         self._comm.on_msg(self._handle_comm_message)
     if self._jm is None:
         self._jm = JobManager()
     if self._msg_map is None:
         self._msg_map = {
             MESSAGE_TYPE["CANCEL"]: self._cancel_jobs,
             MESSAGE_TYPE["CELL_JOB_STATUS"]: self._get_job_states_by_cell_id,
             MESSAGE_TYPE["INFO"]: self._get_job_info,
             MESSAGE_TYPE["LOGS"]: self._get_job_logs,
             MESSAGE_TYPE["RETRY"]: self._retry_jobs,
             MESSAGE_TYPE["START_UPDATE"]: self._modify_job_updates,
             MESSAGE_TYPE["STATUS"]: self._get_job_states,
             MESSAGE_TYPE["STATUS_ALL"]: self._get_all_job_states,
             MESSAGE_TYPE["STOP_UPDATE"]: self._modify_job_updates,
         }
Exemplo n.º 3
0
    def setUpClass(cls):
        cls.maxDiff = None
        cls.am = AppManager()
        cls.am.reload()  # class uses non-mocked data
        cls.jm = JobManager()
        cls.good_app_id = CONFIG.get("app_tests", "good_app_id")
        cls.good_tag = CONFIG.get("app_tests", "good_app_tag")
        cls.bad_app_id = CONFIG.get("app_tests", "bad_app_id")
        cls.bad_tag = CONFIG.get("app_tests", "bad_app_tag")
        cls.test_app_id = CONFIG.get("app_tests", "test_app_id")
        cls.test_app_version = (
            "056582c691c4df190110b059600d2dc2a3a8b80a"  # where is this coming from?
        )
        cls.test_app_module_name = CONFIG.get("app_tests",
                                              "test_app_module_name")
        cls.test_app_method_name = CONFIG.get("app_tests",
                                              "test_app_method_name")
        cls.test_job_id = CONFIG.get("app_tests", "test_job_id")
        cls.test_tag = CONFIG.get("app_tests", "test_app_tag")
        cls.public_ws = CONFIG.get("app_tests", "public_ws_name")
        cls.ws_id = int(CONFIG.get("app_tests", "public_ws_id"))
        cls.app_input_ref = CONFIG.get("app_tests", "test_input_ref")
        cls.batch_app_id = CONFIG.get("app_tests", "batch_app_id")
        cls.test_viewer_app_id = CONFIG.get("app_tests", "test_viewer_app_id")
        cls.test_app_params = {
            "read_library_names": ["rhodo.art.jgi.reads"],
            "output_contigset_name": "rhodo_contigs",
            "recipe": "auto",
            "assembler": "",
            "pipeline": "",
            "min_contig_len": None,
        }

        cls.expected_app_params = {
            "read_library_refs": ["18836/5/1"],
            "output_contigset_name": "rhodo_contigs",
            "recipe": "auto",
            "assembler": None,
            "pipeline": None,
            "min_contig_len": None,
            "workspace_name": cls.public_ws,
        }
Exemplo n.º 4
0
 def setUp(self) -> None:
     self.jm = JobManager()
     self.jm.initialize_jobs()
Exemplo n.º 5
0
"""
Tests for job management
"""
__author__ = "Bill Riehl <*****@*****.**>"

import unittest
import mock
from biokbase.narrative.jobs.jobmanager import JobManager

jm = JobManager()
jm.initialize_jobs()