Skip to content
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
3 changes: 2 additions & 1 deletion qiita_db/processing_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,8 @@ def _complete_artifact_transformation(self, artifacts_data):
cmd = qdb.software.Command.get_validator(atype)
values_dict = {
'files': dumps(filepaths), 'artifact_type': atype,
'template': template, 'provenance': dumps(provenance)}
'template': template, 'provenance': dumps(provenance),
'analysis': None}
if analysis is not None:
values_dict['analysis'] = analysis
validate_params = qdb.software.Parameters.load(
Expand Down
13 changes: 7 additions & 6 deletions qiita_db/test/test_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,31 +450,32 @@ def test_user_artifacts(self):
qdb.artifact.Artifact(7)]}
self.assertEqual(obs, exp)

def test_jobs_all(self):
def test_jobs(self):
PJ = qdb.processing_job.ProcessingJob
ignore_status = []
# generates expected jobs
jobs = qdb.user.User('shared@foo.bar').jobs(
ignore_status=ignore_status)
self.assertEqual(jobs, [PJ('b72369f9-a886-4193-8d3d-f7b504168e75')])

jobs = qdb.user.User('shared@foo.bar').jobs(
ignore_status=ignore_status, show_hidden=True)
self.assertEqual(jobs, [
PJ('d19f76ee-274e-4c1b-b3a2-a12d73507c55'),
PJ('b72369f9-a886-4193-8d3d-f7b504168e75')])

# just one job
self.assertEqual(qdb.user.User('shared@foo.bar').jobs(
limit=1, ignore_status=ignore_status), [
PJ('d19f76ee-274e-4c1b-b3a2-a12d73507c55')])
PJ('b72369f9-a886-4193-8d3d-f7b504168e75')])

# no jobs
self.assertEqual(qdb.user.User('admin@foo.bar').jobs(
ignore_status=ignore_status), [])

def test_jobs_defaults(self):
PJ = qdb.processing_job.ProcessingJob
# generates expected jobs
jobs = qdb.user.User('shared@foo.bar').jobs()
self.assertEqual(jobs, [
PJ('d19f76ee-274e-4c1b-b3a2-a12d73507c55')])
self.assertEqual(jobs, [])

# no jobs
self.assertEqual(qdb.user.User('admin@foo.bar').jobs(), [])
Expand Down
7 changes: 6 additions & 1 deletion qiita_db/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ def delete_messages(self, messages):
qdb.sql_connection.TRN.add(sql)
qdb.sql_connection.TRN.execute()

def jobs(self, limit=30, ignore_status=['success']):
def jobs(self, limit=30, ignore_status=['success'], show_hidden=False):
"""Return jobs created by the user

Parameters
Expand All @@ -669,6 +669,8 @@ def jobs(self, limit=30, ignore_status=['success']):
max number of rows to return
ignore_status: list of str, optional
don't retieve jobs that have one of these status
show_hidden: bool, optional
If true, return all jobs, including the hidden ones

Returns
-------
Expand All @@ -689,6 +691,9 @@ def jobs(self, limit=30, ignore_status=['success']):
else:
sql_info = [self._id, limit]

if not show_hidden:
sql += ' AND hidden = false'

sql += """
ORDER BY CASE processing_job_status
WHEN 'in_construction' THEN 1
Expand Down
16 changes: 1 addition & 15 deletions qiita_pet/handlers/api_proxy/tests/test_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,7 @@ def test_user_jobs_get_req(self):
exp = {
'status': 'success',
'message': '',
'jobs': [
{'id': 'd19f76ee-274e-4c1b-b3a2-a12d73507c55',
'status': 'error',
'heartbeat': '2015-11-22 21:30:00',
'params': {
'reference': 1,
'similarity': 0.97,
'sortmerna_e_value': 1,
'sortmerna_max_pos': 10000,
'input_data': 2,
'threads': 1,
'sortmerna_coverage': 0.97},
'name': 'Pick closed-reference OTUs',
'step': 'generating demux file',
'processing_job_workflow_id': 1}]}
'jobs': []}
self.assertEqual(obs, exp)


Expand Down
6 changes: 5 additions & 1 deletion qiita_pet/static/js/networkVue.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Vue.component('processing-graph', {
'<div class="row" id="network-header-div">' +
'<div class="col-md-12">' +
'<h4><a class="btn btn-info" id="show-hide-network-btn" onclick="toggleNetworkGraph();">Hide</a><i> Processing network </i></h4>' +
'Graph interaction: <a class="btn btn-danger" id="interaction-btn">Disabled</a></br>' +
'Graph navigation: <a class="btn btn-danger" id="interaction-btn">Disabled</a></br>' +
'<div id="run-btn-div"><a class="btn btn-success" id="run-btn"><span class="glyphicon glyphicon-play"></span> Run workflow</a><span class="blinking-message"> Don\'t forget to hit "Run" once you are done with your workflow!</span></div>' +
'<b>Click circles for more information - This graph will refresh in <span id="countdown-span"></span> seconds or reload <a href="#" id="refresh-now-link">now</a></b>' +
'</div>' +
Expand Down Expand Up @@ -321,6 +321,10 @@ Vue.component('processing-graph', {
rowsContent.push(['Current step:', data['job_step']]);
}

if (data['job_status'] === 'error' && data['job_error'] !== null) {
rowsContent.push(['Error message:', data['job_error']]);
}

// Create the DOM elements to add the rows content
for (var row of rowsContent) {
$rowDiv = $('<div>').addClass('row').addClass('form-group').appendTo("#processing-results");
Expand Down