def test_submit_EBI_step_2_failure(self): ppd = self.write_demux_files(PrepTemplate(1), True) pid = ppd.id with self.assertRaises(ComputeError): submit_EBI(pid, 'VALIDATE', True) rmtree(join(self.base_fp, '%d_ebi_submission' % pid), True)
def test_full_submission(self): artifact = self.generate_new_study_with_preprocessed_data() self.assertEqual(artifact.study.ebi_submission_status, 'not submitted') aid = artifact.id submit_EBI(aid, 'VALIDATE', True, test=True) self.assertEqual(artifact.study.ebi_submission_status, 'submitted') rmtree(join(self.base_fp, '%d_ebi_submission' % aid), True)
def test_full_submission(self): artifact = self.generate_new_study_with_preprocessed_data() self.assertEqual( artifact.study.ebi_submission_status, 'not submitted') aid = artifact.id submit_EBI(aid, 'VALIDATE', True, test=True) self.assertEqual(artifact.study.ebi_submission_status, 'submitted') rmtree(join(self.base_fp, '%d_ebi_submission' % aid), True)
def test_max_ebiena_curl_error(self): artifact = self.generate_new_study_with_preprocessed_data() self.assertEqual(artifact.study.ebi_submission_status, 'not submitted') aid = artifact.id with self.assertRaises(ComputeError) as error: submit_EBI(aid, 'VALIDATE', True, test_size=True) error = str(error.exception) self.assertIn('is too large. Before cleaning:', error) rmtree(join(self.base_fp, '%d_ebi_submission' % aid), True)
def test_submit_EBI_parse_EBI_reply_failure(self): ppd = self.write_demux_files(PrepTemplate(1)) with self.assertRaises(ComputeError) as error: submit_EBI(ppd.id, 'VALIDATE', True) error = str(error.exception) self.assertIn('EBI Submission failed! Log id:', error) self.assertIn('The EBI submission failed:', error) self.assertIn('Failed to validate run xml, error: Expected element', error)
def test_submit_EBI_parse_EBI_reply_failure(self): ppd = self.write_demux_files(PrepTemplate(1)) pid = ppd.id with self.assertRaises(ComputeError) as error: submit_EBI(pid, 'VALIDATE', True) error = str(error.exception) self.assertIn('EBI Submission failed! Log id:', error) self.assertIn('The EBI submission failed:', error) rmtree(join(self.base_fp, '%d_ebi_submission' % pid), True)
def test_max_ebiena_curl_error(self): artifact = self.generate_new_study_with_preprocessed_data() self.assertEqual( artifact.study.ebi_submission_status, 'not submitted') aid = artifact.id with self.assertRaises(ComputeError) as error: submit_EBI(aid, 'VALIDATE', True, test_size=True) error = str(error.exception) self.assertIn('is too large. Before cleaning:', error) rmtree(join(self.base_fp, '%d_ebi_submission' % aid), True)
def submit_to_EBI(job): """Submit a study to EBI Parameters ---------- job : qiita_db.processing_job.ProcessingJob The processing job performing the task """ with qdb.sql_connection.TRN: param_vals = job.parameters.values artifact_id = int(param_vals['artifact']) submission_type = param_vals['submission_type'] submit_EBI(artifact_id, submission_type, True) job._set_status('success')
def submit_to_ebi(preprocessed_data_id, submission_type): """Submit a study to EBI""" study_acc, submission_acc = submit_EBI(preprocessed_data_id, submission_type, True) return study_acc, submission_acc
def submit_to_EBI(job): """Submit a study to EBI Parameters ---------- job : qiita_db.processing_job.ProcessingJob The processing job performing the task """ with qdb.sql_connection.TRN: param_vals = job.parameters.values artifact_id = int(param_vals['artifact']) submission_type = param_vals['submission_type'] artifact = qdb.artifact.Artifact(artifact_id) for info in artifact.study._ebi_submission_jobs(): jid, aid, js, cbste, era = info if js in ('running', 'queued') and jid != job.id: error_msg = ("Cannot perform parallel EBI submission for " "the same study. Current job running: %s" % js) raise EBISubmissionError(error_msg) submit_EBI(artifact_id, submission_type, True) job._set_status('success')
def test_full_submission(self): artifact = self.generate_new_study_with_preprocessed_data() self.assertEqual(artifact.study.ebi_submission_status, 'not submitted') submit_EBI(artifact.id, 'VALIDATE', True, test=True) self.assertEqual(artifact.study.ebi_submission_status, 'submitted')
def test_submit_EBI_step_2_failure(self): ppd = self.write_demux_files(PrepTemplate(1), False) with self.assertRaises(EBISubmissionError): submit_EBI(ppd.id, 'VALIDATE', True)
def test_submit_EBI_parse_EBI_reply_failure(self): ppd = self.write_demux_files(PrepTemplate(1)) with self.assertRaises(ComputeError): submit_EBI(ppd.id, 'ADD', True)