Skip to content

Fix summary #2037

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 4 commits into from
Jan 4, 2017
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: 1 addition & 1 deletion qiita_db/processing_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ def complete(self, success, artifacts_data=None, error=None):
else:
if self.command.software.type == 'artifact definition':
job_params = self.parameters.values
if job_params['provenance'] is not None:
if job_params.get('provenance') is not None:
# This artifact definition job is a result of a command
# run, if it fails, set up the status of the "parent"
# job also as failed, and assign the sem error message
Expand Down
9 changes: 9 additions & 0 deletions qiita_db/test/test_processing_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,15 @@ def test_complete_no_artifact_data(self):
job.complete(True)
self.assertEqual(job.status, 'success')

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(False, error='Some Error')
self.assertEqual(job.status, 'error')

def test_complete_type(self):
fd, fp = mkstemp(suffix="_table.biom")
self._clean_up_files.append(fp)
Expand Down
10 changes: 0 additions & 10 deletions scripts/qiita
Original file line number Diff line number Diff line change
Expand Up @@ -491,15 +491,5 @@ def update():
_activate_or_update_plugins(update=True)


# #############################################################################
# PRIVATE COMMANDS
# #############################################################################
@private.command()
@click.argument('job_id', required=True, type=click.STRING)
@click.argument('payload', required=True, type=click.STRING)
def complete_job(job_id, payload):
qdb.commands.complete_job_cmd(job_id, payload)


if __name__ == '__main__':
qiita()
27 changes: 27 additions & 0 deletions scripts/qiita-private
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env python

# -----------------------------------------------------------------------------
# Copyright (c) 2014--, The Qiita Development Team.
#
# Distributed under the terms of the BSD 3-clause License.
#
# The full license is in the file LICENSE, distributed with this software.
# -----------------------------------------------------------------------------

import click
import qiita_db as qdb


@click.group()
def qiita_private():
pass


@qiita_private.command()
@click.argument('job_id', required=True, type=click.STRING)
@click.argument('payload', required=True, type=click.STRING)
def complete_job(job_id, payload):
qdb.commands.complete_job_cmd(job_id, payload)

if __name__ == '__main__':
qiita_private()
4 changes: 1 addition & 3 deletions scripts/qiita-private-launcher
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,12 @@ source ~/.bash_profile
@click.argument('arguments', required=True, nargs=-1)
def start(qiita_env, command, arguments):
"""Starts the plugin environment"""
cmd = ['qiita private', command]
cmd = ['qiita-private', command]
cmd.extend(["'%s'" % arg for arg in arguments])
fd, fp = mkstemp(suffix=".sh")
close(fd)
with open(fp, 'w') as f:
f.write(SCRIPT % (qiita_env, ' '.join(cmd)))
with open("/home/travis/trying_to_debug.txt", "w") as f:
f.write(SCRIPT % (qiita_env, ' '.join(cmd)))
cmd = "bash %s" % fp
proc = Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE)
stdout, stderr = proc.communicate()
Expand Down