Skip to content

Commit 773f640

Browse files
authored
some general fixes/additions for next release (#3026)
* some general fixes/additions for next release * adding test for not None job.release_validator_job
1 parent 68ffc5a commit 773f640

File tree

3 files changed

+42
-6
lines changed

3 files changed

+42
-6
lines changed

README.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ compute resources to the global community, alleviating the technical burdens,
1717
such as familiarity with the command line or access to compute power, that are
1818
typically limiting for researchers studying microbial ecology.
1919

20-
Qiita is currently in alpha status. We are very open to community
20+
Qiita is currently in beta status. We are very open to community
2121
contributions and feedback. If you're interested in contributing to Qiita,
2222
see `CONTRIBUTING.md <https://github.com/biocore/qiita/blob/master/CONTRIBUTING.md>`__.
2323
If you'd like to report bugs or request features, you can do that in the
@@ -43,9 +43,7 @@ Current features
4343

4444
* Target gene data: we support deblur against GreenGenes (13_8) and close
4545
reference picking against GreenGenes (13_8) and Silva.
46-
* Metagenoic/Shotgun data: we support Shogun processing. Note that this data
47-
is suitable for download and further down stream analyses but we don't recommend
48-
meta-analysis within Qiita (only single study).
46+
* Metagenomic and Metatranscriptomic data: we support Shogun processing.
4947
* biom files can be added as new preparation templates for downstream
5048
analyses; however, this cannot be made public.
5149

qiita_db/processing_job.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -821,6 +821,31 @@ def external_id(self, value):
821821
qdb.sql_connection.TRN.add(sql, [value, self.id])
822822
qdb.sql_connection.TRN.execute()
823823

824+
@property
825+
def release_validator_job(self):
826+
"""Retrieves the release validator job
827+
828+
Returns
829+
-------
830+
qiita_db.processing_job.ProcessingJob or None
831+
The release validator job of this job
832+
"""
833+
rvalidator = None
834+
with qdb.sql_connection.TRN:
835+
sql = """SELECT processing_job_id
836+
FROM qiita.processing_job
837+
WHERE command_id in (
838+
SELECT command_id
839+
FROM qiita.software_command
840+
WHERE name = 'release_validators')
841+
AND command_parameters->>'job' = %s"""
842+
qdb.sql_connection.TRN.add(sql, [self.id])
843+
results = qdb.sql_connection.TRN.execute_fetchflatten()
844+
if results:
845+
rvalidator = ProcessingJob(results[0])
846+
847+
return rvalidator
848+
824849
def submit(self, parent_job_id=None, dependent_jobs_list=None):
825850
"""Submits the job to execution
826851
This method has the ability to submit itself, as well as a list of

qiita_db/test/test_processing_job.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,10 @@ def test_complete_type(self):
446446
qdb.artifact.Artifact(exp_artifact_count).filepaths])
447447

448448
def test_complete_success(self):
449+
# Note that here we are submitting and creating other multiple jobs;
450+
# thus here is the best place to test any intermediary steps/functions
451+
# of the job creation, submission, exectution, and completion.
452+
#
449453
# This first part of the test is just to test that by default the
450454
# naming of the output artifact will be the name of the output
451455
fd, fp = mkstemp(suffix='_table.biom')
@@ -457,8 +461,16 @@ def test_complete_success(self):
457461
'artifact_type': 'BIOM'}}
458462
job = _create_job()
459463
job._set_status('running')
464+
465+
# here we can test that job.release_validator_job hasn't been created
466+
# yet so it has to be None
467+
self.assertIsNone(job.release_validator_job)
460468
job.complete(True, artifacts_data=artifacts_data)
461469
self._wait_for_job(job)
470+
# let's check for the job that released the validators
471+
self.assertIsNotNone(job.release_validator_job)
472+
self.assertEqual(job.release_validator_job.parameters.values['job'],
473+
job.id)
462474
# Retrieve the job that is performing the validation:
463475
validators = list(job.validator_jobs)
464476
self.assertEqual(len(validators), 1)
@@ -858,8 +870,9 @@ def test_raise_if_not_in_construction_error(self):
858870
tester._raise_if_not_in_construction()
859871

860872
def test_submit(self):
861-
# In order to test a success, we need to actually run the jobs, which
862-
# will mean to run split libraries, for example.
873+
# The submit method is being tested in test_complete_success via
874+
# a job, its release validators and validators submissions.
875+
# Leaving this note here in case it's helpful for future development
863876
pass
864877

865878
def test_from_default_workflow(self):

0 commit comments

Comments
 (0)