Skip to content

Commit

Permalink
Merge pull request #3094 from antgonza/fix-3079
Browse files Browse the repository at this point in the history
fix #3079
  • Loading branch information
wasade authored Apr 28, 2021
2 parents cac9820 + 195cabf commit d3dd942
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions qiita_ware/private_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ def complete_job(job):
artifacts = None
error = payload['error']
c_job = qdb.processing_job.ProcessingJob(param_vals['job_id'])
c_job.step = 'Completing via %s [%s]' % (job.id, job.external_id)
try:
c_job.complete(payload['success'], artifacts, error)
except Exception:
Expand Down
11 changes: 11 additions & 0 deletions qiita_ware/test/test_private_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,13 +276,24 @@ def test_complete_job(self):
f.write('\n')
self._clean_up_files.append(fp)
exp_artifact_count = get_count('qiita.artifact') + 1

# the main job (c_job) is still not completing so the step hasn't been
# updated since creation === None
self.assertIsNone(c_job.step)

payload = dumps(
{'success': True, 'error': '',
'artifacts': {'OTU table': {'filepaths': [(fp, 'biom')],
'artifact_type': 'BIOM'}}})
job = self._create_job('complete_job', {'job_id': c_job.id,
'payload': payload})
private_task(job.id)

# the complete job has started so now the step of c_job should report
# the complete information
self.assertEqual(c_job.step,
f"Completing via {job.id} [Not Available]")

self.assertEqual(job.status, 'success')
self.assertEqual(c_job.status, 'success')
self.assertEqual(get_count('qiita.artifact'), exp_artifact_count)
Expand Down

0 comments on commit d3dd942

Please sign in to comment.