def sample_sheet(self): if self._sample_sheet is None: sample_sheet_path = os.path.join(self.path, 'SampleSheet.csv') if os.path.exists(sample_sheet_path): self._sample_sheet = SampleSheetParser(sample_sheet_path).data else: logging.warning("SampleSheet.csv does not exist: {}".format( os.path.abspath(sample_sheet_path))) path = config.get('sample_sheet_path', {}).get('hiseqx') if path is None: logging.error( "'sample_sheet_path' missing in the config file") raise RuntimeError( "'sample_sheet_path' missing in the config file: {}". format(config.get('config_path'))) else: sample_sheet_path = os.path.join(path, self.name, 'SampleSheet.csv') if os.path.exists(sample_sheet_path): self._sample_sheet = SampleSheetParser( sample_sheet_path).data else: logging.error( "SampleSheet.csv does not exist at {}".format( sample_sheet_path)) raise RuntimeError( "SampleSheet.csv does not exist at {}".format( sample_sheet_path)) return self._sample_sheet
def test_flowcells(hiseqx, hiseq, miseq, all): """ Run unittests with the default config file: tests/config.yaml. To change it, edit tests/test_<fc-type>.py file""" # load_yaml_config(config_file) if not config.get('trello', ''): logging.error("Config file missing required entries: 'trello'") raise RuntimeError("Config file missing required entries: 'trello'") if not config.get('data_folders', ''): logging.error("Config file missing required entries: 'data_folders'") raise RuntimeError( "Config file missing required entries: 'data_folders'") data_folders = [] for data_folder in config.get('data_folders'): if not data_folder.startswith('/'): script_path = os.path.realpath(__file__) dirname = os.path.dirname(script_path) abs_path = os.path.join(dirname, data_folder) data_folders.append(abs_path) config.update({'data_folders': data_folders}) if all or not any([hiseqx, hiseq, miseq]): # if no flags or flag=all for Test in [TestMiseq, TestHiseq, TestHiseqX]: suite = unittest.TestLoader().loadTestsFromTestCase(Test) unittest.TextTestRunner(verbosity=2).run(suite) else: if hiseqx: suite = unittest.TestLoader().loadTestsFromTestCase(TestHiseqX) unittest.TextTestRunner(verbosity=2).run(suite) if hiseq: suite = unittest.TestLoader().loadTestsFromTestCase(TestHiseq) unittest.TextTestRunner(verbosity=2).run(suite) if miseq: suite = unittest.TestLoader().loadTestsFromTestCase(TestMiseq) unittest.TextTestRunner(verbosity=2).run(suite)
def monitor_flowcells(): """ Collect information from the filesystem and update the trello board""" if not CONFIG.get('trello', ''): logging.error("Config file missing required entries: 'trello'") raise RuntimeError("Config file missing required entries: 'trello'") if not CONFIG.get('data_folders', ''): logging.error("Config file missing required entries: 'data_folders'") raise RuntimeError( "Config file missing required entries: 'data_folders'") flowcell_monitor = FlowcellMonitor(CONFIG) flowcell_monitor.update_trello_board()
def test_transferring(self): fc = BaseFlowcell.init_flowcell(self.original_flowcell) self.assertIsNotNone(fc.transfering_started) # to make sure it's a datetime and nothing else transfering = { 'hiseqx': { 'url': 'localhost', 'username': '******', 'path': os.path.join(os.path.abspath('tests/test_data/hiseqx')) #)'/Users/ekaterinastepanova/work/hugin/tests/test_data/hiseqx' } } config.update({'transfering': transfering}) self.assertGreater(datetime.datetime.now(), fc.transfering_started)
def test_transferring(self): fc = BaseFlowcell.init_flowcell(self.original_flowcell) self.assertIsNotNone(fc.transfering_started) # to make sure it's a datetime and nothing else transfering = { 'hiseqx': { 'url': 'localhost', 'username': '******', 'path': os.path.join( os.path.abspath('tests/test_data/hiseqx') ) #)'/Users/ekaterinastepanova/work/hugin/tests/test_data/hiseqx' } } config.update({'transfering': transfering}) self.assertGreater(datetime.datetime.now(), fc.transfering_started)
def sample_sheet(self): if self._sample_sheet is None: sample_sheet_path = os.path.join(self.path, 'SampleSheet.csv') if os.path.exists(sample_sheet_path): self._sample_sheet = SampleSheetParser(sample_sheet_path).data else: logging.warning("SampleSheet.csv does not exist: {}".format(os.path.abspath(sample_sheet_path))) path = config.get('sample_sheet_path', {}).get('hiseqx') if path is None: logging.error("'sample_sheet_path' missing in the config file") raise RuntimeError("'sample_sheet_path' missing in the config file: {}".format(config.get('config_path'))) else: sample_sheet_path = os.path.join(path, self.name, 'SampleSheet.csv') if os.path.exists(sample_sheet_path): self._sample_sheet = SampleSheetParser(sample_sheet_path).data else: logging.error("SampleSheet.csv does not exist at {}".format(sample_sheet_path)) raise RuntimeError("SampleSheet.csv does not exist at {}".format(sample_sheet_path)) return self._sample_sheet
def test_flowcell_monitor(self): monitor = FlowcellMonitor(self.config) data_folders = monitor.data_folders self.assertEqual(data_folders, config.get('data_folders'))
def test_flowcell_monitor(self): monitor = FlowcellMonitor(self.config) data_folders = monitor.data_folders self.assertEqual(data_folders, config.get('data_folders'))