def test_hook_implementations(): pm = ErtPluginManager(plugins=[semeio.hook_implementations.jobs]) expected_jobs = { "DESIGN_KW": "semeio/jobs/config_jobs/DESIGN_KW", "DESIGN2PARAMS": "semeio/jobs/config_jobs/DESIGN2PARAMS", "STEA": "semeio/jobs/config_jobs/STEA", "GENDATA_RFT": "semeio/jobs/config_jobs/GENDATA_RFT", "PYSCAL": "semeio/jobs/config_jobs/PYSCAL", } installable_jobs = pm.get_installable_jobs() for wf_name, wf_location in expected_jobs.items(): assert wf_name in installable_jobs assert installable_jobs[wf_name].endswith(wf_location) assert set(installable_jobs.keys()) == set(expected_jobs.keys()) expected_workflow_jobs = { "CORRELATED_OBSERVATIONS_SCALING": "semeio/jobs/config_workflow_jobs/CORRELATED_OBSERVATIONS_SCALING", "SPEARMAN_CORRELATION": "semeio/jobs/config_workflow_jobs/SPEARMAN_CORRELATION", } installable_workflow_jobs = pm.get_installable_workflow_jobs() for wf_name, wf_location in expected_workflow_jobs.items(): assert wf_name in installable_workflow_jobs assert installable_workflow_jobs[wf_name].endswith(wf_location) assert set(installable_workflow_jobs.keys()) == set( expected_workflow_jobs.keys())
def test_hook_implementations_job_docs(): pm = ErtPluginManager(plugins=[semeio.hook_implementations.jobs]) installable_jobs = pm.get_installable_jobs() docs = pm.get_documentation_for_jobs() assert set(docs.keys()) == set(installable_jobs.keys()) for job_name in installable_jobs.keys(): assert docs[job_name]["description"] != "" assert docs[job_name]["category"] != "other"
def test_hook_implementations_job_docs(): """Test extracting docs from ERT hooks""" plugin_m = ErtPluginManager(plugins=[ecl2df.hook_implementations.jobs]) installable_jobs = plugin_m.get_installable_jobs() docs = plugin_m.get_documentation_for_jobs() assert set(docs.keys()) == set(installable_jobs.keys()) for job_name in installable_jobs.keys(): print(job_name) assert docs[job_name]["description"] != "" assert docs[job_name]["category"] != "other"
def test_hook_implementations_job_docs(): """For each installed job, we require the associated description string to be nonempty, and valid RST markup""" plugin_m = ErtPluginManager(plugins=[webviz_subsurface.ert_jobs.jobs]) installable_jobs = plugin_m.get_installable_jobs() docs = plugin_m.get_documentation_for_jobs() assert set(docs.keys()) == set(installable_jobs.keys()) for job_name in installable_jobs.keys(): desc = docs[job_name]["description"] assert desc != "" category = docs[job_name]["category"] assert category != "other" assert category.split(".")[0] in ACCEPTED_JOB_CATEGORIES
def test_hook_implementations(): """Test that the expected jobs can be found using an ERT plugin manager""" plugin_m = ErtPluginManager(plugins=[ecl2df.hook_implementations.jobs]) installable_jobs = plugin_m.get_installable_jobs() for wf_name, wf_location in EXPECTED_JOBS.items(): assert wf_name in installable_jobs assert installable_jobs[wf_name].endswith(wf_location) assert Path(installable_jobs[wf_name]).is_file() assert set(installable_jobs.keys()) == set(EXPECTED_JOBS.keys()) expected_workflow_jobs = {} installable_workflow_jobs = plugin_m.get_installable_workflow_jobs() for wf_name, wf_location in expected_workflow_jobs.items(): assert wf_name in installable_workflow_jobs assert installable_workflow_jobs[wf_name].endswith(wf_location) assert set(installable_workflow_jobs.keys()) == set( expected_workflow_jobs.keys())
def test_hook_implementations(expected_jobs): """Test that we have the correct set of jobs installed, nothing more, nothing less""" plugin_m = ErtPluginManager(plugins=[subscript.hook_implementations.jobs]) installable_jobs = plugin_m.get_installable_jobs() for wf_name, wf_location in expected_jobs.items(): assert wf_name in installable_jobs assert installable_jobs[wf_name].endswith(wf_location) assert path.isfile(installable_jobs[wf_name]) assert set(installable_jobs.keys()) == set(expected_jobs.keys()) expected_workflow_jobs = {} installable_workflow_jobs = plugin_m.get_installable_workflow_jobs() for wf_name, wf_location in expected_workflow_jobs.items(): assert wf_name in installable_workflow_jobs assert installable_workflow_jobs[wf_name].endswith(wf_location) assert set(installable_workflow_jobs.keys()) == set(expected_workflow_jobs.keys())
def test_hook_implementations(): pm = ErtPluginManager(plugins=[ semeio.hook_implementations.jobs, spearman_correlation, misfit_preprocessor, cos, csv_export2, ahmanalysis, ]) expected_jobs = { "DESIGN_KW": "semeio/jobs/config_jobs/DESIGN_KW", "DESIGN2PARAMS": "semeio/jobs/config_jobs/DESIGN2PARAMS", "STEA": "semeio/jobs/config_jobs/STEA", "GENDATA_RFT": "semeio/jobs/config_jobs/GENDATA_RFT", "PYSCAL": "semeio/jobs/config_jobs/PYSCAL", "INSERT_NOSIM": "semeio/jobs/config_jobs/INSERT_NOSIM", "REMOVE_NOSIM": "semeio/jobs/config_jobs/REMOVE_NOSIM", "OTS": "semeio/jobs/config_jobs/OTS", } installable_jobs = pm.get_installable_jobs() for wf_name, wf_location in expected_jobs.items(): assert wf_name in installable_jobs assert installable_jobs[wf_name].endswith(wf_location) assert set(installable_jobs.keys()) == set(expected_jobs.keys()) expected_workflow_jobs = [ "CORRELATED_OBSERVATIONS_SCALING", "SPEARMAN_CORRELATION", "CSV_EXPORT2", "MISFIT_PREPROCESSOR", "AHM_ANALYSIS", ] installable_workflow_jobs = pm.get_installable_workflow_jobs() for wf_name, wf_location in installable_workflow_jobs.items(): assert wf_name in expected_workflow_jobs assert os.path.isfile(wf_location) assert set(installable_workflow_jobs.keys()) == set(expected_workflow_jobs)
def test_hook_implementations(self): pm = ErtPluginManager(plugins=[equilibrium.hook_implementations.jobs]) self.assertDictEqual({}, pm.get_installable_jobs()) self.assertDictEqual({}, pm.get_installable_workflow_jobs())