Skip to content

Fixing bug with summary jobs #2025

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 16, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions qiita_db/processing_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,8 @@ def complete(self, success, artifacts_data=None, error=None):
self._complete_artifact_definition(a_data)
else:
self._complete_artifact_transformation(artifacts_data)
else:
self._set_status('success')
else:
if self.command.software.type == 'artifact definition':
job_params = self.parameters.values
Expand Down
18 changes: 17 additions & 1 deletion qiita_db/test/test_processing_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,16 @@ def test_complete_artifact_transformation(self):
# Implicitly tested by "test_complete"
pass

def test_complete_no_artifact_data(self):
job = qdb.processing_job.ProcessingJob.create(
qdb.user.User('test@foo.bar'),
qdb.software.Parameters.load(
qdb.software.Command(5),
values_dict={"input_data": 1}))
job._set_status('running')
job.complete(True)
self.assertEqual(job.status, 'success')

def test_complete_type(self):
fd, fp = mkstemp(suffix="_table.biom")
self._clean_up_files.append(fp)
Expand Down Expand Up @@ -448,7 +458,13 @@ def test_complete_success(self):
alljobs = set(self._get_all_job_ids())

job.complete(True, artifacts_data=artifacts_data)
self.assertTrue(job.status, 'success')
# When completing the previous job, it creates a new job that needs
# to validate the BIOM table that is being added as new artifact.
# Hence, this job is still in running state until the validation job
# is completed. Note that this is tested by making sure that the status
# of this job is running, and that we have one more job than before
# (see assertEqual with len of all jobs)
self.assertEqual(job.status, 'running')

obsjobs = set(self._get_all_job_ids())

Expand Down