Skip to content

Commit 80c5fea

Browse files
josenavasantgonza
authored andcommitted
Fix summary (#2037)
* Removing travis debugging * Fixing error and adding a specific test * Adding qiita-private script to avoid connecting to the ipython cluster * Adding exec bit
1 parent 46b7d0b commit 80c5fea

File tree

5 files changed

+38
-14
lines changed

5 files changed

+38
-14
lines changed

qiita_db/processing_job.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ def complete(self, success, artifacts_data=None, error=None):
600600
else:
601601
if self.command.software.type == 'artifact definition':
602602
job_params = self.parameters.values
603-
if job_params['provenance'] is not None:
603+
if job_params.get('provenance') is not None:
604604
# This artifact definition job is a result of a command
605605
# run, if it fails, set up the status of the "parent"
606606
# job also as failed, and assign the sem error message

qiita_db/test/test_processing_job.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,15 @@ def test_complete_no_artifact_data(self):
404404
job.complete(True)
405405
self.assertEqual(job.status, 'success')
406406

407+
job = qdb.processing_job.ProcessingJob.create(
408+
qdb.user.User('test@foo.bar'),
409+
qdb.software.Parameters.load(
410+
qdb.software.Command(5),
411+
values_dict={"input_data": 1}))
412+
job._set_status('running')
413+
job.complete(False, error='Some Error')
414+
self.assertEqual(job.status, 'error')
415+
407416
def test_complete_type(self):
408417
fd, fp = mkstemp(suffix="_table.biom")
409418
self._clean_up_files.append(fp)

scripts/qiita

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -491,15 +491,5 @@ def update():
491491
_activate_or_update_plugins(update=True)
492492

493493

494-
# #############################################################################
495-
# PRIVATE COMMANDS
496-
# #############################################################################
497-
@private.command()
498-
@click.argument('job_id', required=True, type=click.STRING)
499-
@click.argument('payload', required=True, type=click.STRING)
500-
def complete_job(job_id, payload):
501-
qdb.commands.complete_job_cmd(job_id, payload)
502-
503-
504494
if __name__ == '__main__':
505495
qiita()

scripts/qiita-private

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env python
2+
3+
# -----------------------------------------------------------------------------
4+
# Copyright (c) 2014--, The Qiita Development Team.
5+
#
6+
# Distributed under the terms of the BSD 3-clause License.
7+
#
8+
# The full license is in the file LICENSE, distributed with this software.
9+
# -----------------------------------------------------------------------------
10+
11+
import click
12+
import qiita_db as qdb
13+
14+
15+
@click.group()
16+
def qiita_private():
17+
pass
18+
19+
20+
@qiita_private.command()
21+
@click.argument('job_id', required=True, type=click.STRING)
22+
@click.argument('payload', required=True, type=click.STRING)
23+
def complete_job(job_id, payload):
24+
qdb.commands.complete_job_cmd(job_id, payload)
25+
26+
if __name__ == '__main__':
27+
qiita_private()

scripts/qiita-private-launcher

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,12 @@ source ~/.bash_profile
3131
@click.argument('arguments', required=True, nargs=-1)
3232
def start(qiita_env, command, arguments):
3333
"""Starts the plugin environment"""
34-
cmd = ['qiita private', command]
34+
cmd = ['qiita-private', command]
3535
cmd.extend(["'%s'" % arg for arg in arguments])
3636
fd, fp = mkstemp(suffix=".sh")
3737
close(fd)
3838
with open(fp, 'w') as f:
3939
f.write(SCRIPT % (qiita_env, ' '.join(cmd)))
40-
with open("/home/travis/trying_to_debug.txt", "w") as f:
41-
f.write(SCRIPT % (qiita_env, ' '.join(cmd)))
4240
cmd = "bash %s" % fp
4341
proc = Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE)
4442
stdout, stderr = proc.communicate()

0 commit comments

Comments
 (0)