Skip to content
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

added screed and read_parser streaming testing #644

Merged
merged 7 commits into from Nov 16, 2014
Merged

Conversation

bocajnotnef
Copy link
Contributor

Marked as known failing since they currently fail.
Will investigate.

Relevant to #393, #654

# create the subprocess of the script
scriptp = \
subprocess.Popen(['normalize-by-median.py -C 2 -k 17 /dev/stdin'],
shell=True, stdin=subprocess.PIPE, stderr=subprocess.PIPE)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I run this on the command line with screed 0.7 and 0.7.1 it works. Maybe using a FIFO named pipe (os.mkfifo) like we did when we were debugging with GDB would do the trick. That way you can still invoke the script using utils.runscript like the rest of the tests.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I was using redirection instead of a pipe which evidently matters (??).

@bocajnotnef
Copy link
Contributor Author

  • Augment testing for empty files in khmer/file.py to not test for empty on block devices

@mr-c
Copy link
Contributor

mr-c commented Nov 3, 2014

Retest this please

@bocajnotnef
Copy link
Contributor Author

Tests redesigned to use fifos within python to hold to the current testing structure (i.e. runscript())

Next up:

  • Fasta test
  • Fastq test
  • gzip test (fasta, fastq)
  • bzip test (fasta, fastq)

@bocajnotnef
Copy link
Contributor Author

Breakdown of which script uses what reading library:

screed:

  • count-median
  • extract-long
  • extract-paired
  • extract-partitions
  • fastq-to-fasta
  • interleave-reads
  • normalize-by-median
  • sample-reads-randomly
  • split-paired-reads

readparser:

  • abundance-dist-single
  • filter-abund-single
  • load-graph
  • load-into-counting

@mr-c mr-c mentioned this pull request Nov 5, 2014
@mr-c
Copy link
Contributor

mr-c commented Nov 5, 2014

retest this please

@bocajnotnef
Copy link
Contributor Author

retest this please

@bocajnotnef
Copy link
Contributor Author

retest this please

@bocajnotnef
Copy link
Contributor Author

Should be noted that these tests are all marked known-failing because we need lower level seqan for streaming to work and (at least) screed 0.7.1 for non-gzip streaming to work in screed.

In order to verify that these work you'd have to edit the setup.cfg to run known_failing tests and to not stop on a test failure and then run the test_scripts.py stuff manually as documented in the docs.

  • Is it mergable
  • Did it pass the tests?
  • If it introduces new functionality in scripts/ is it tested?
    Check for code coverage.
  • Is it well formatted? Look at pep8/pylint, cppcheck, and
    make doc output. Use autopep8 and astyle -A10 --max-code-length=80
    if needed.
  • Is it documented in the Changelog?
  • Was spellcheck run on the source code and documentation after changes
    were made?

@brtaylor92, @b-wyss, @camillescott, CR please?



def check_file_status(file_path):
"""
Check status of file - return if file exists; warn and exit
if empty, or does not exist
This check will return if the file being checked is a block device
This check will return if the file being checked is a fifo
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pls combine sentences.

@bocajnotnef
Copy link
Contributor Author

@brtaylor92 @b-wyss @wrightmhw Requesting CR


mode = os.stat(file_path).st_mode
# block devices will be nonzero
if S_ISBLK(mode):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not

if S_ISBLK(mode) or S_ISFIFO(mode):

?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mm. Good point.

@ctb
Copy link
Member

ctb commented Nov 14, 2014

A few more comments, but otherwise LGTM.

@bocajnotnef
Copy link
Contributor Author

Comments as in add more comments in the code, or...?

@ctb
Copy link
Member

ctb commented Nov 14, 2014

On Fri, Nov 14, 2014 at 10:42:42AM -0800, bocajnotnef wrote:

Comments as in add more comments in the code, or...?

I made more comments that you should look at!

@bocajnotnef
Copy link
Contributor Author

Ah. Sorry. git inline formatting confusing. Resolving comments.

@bocajnotnef
Copy link
Contributor Author

Really not a fan of merge conflicts.

@ctb Should be good for final pass. Hopefully.

@@ -11,13 +11,21 @@

import os
import sys
from stat import *
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, just import S_ISBLK and S_ISFIFO here.

@ctb
Copy link
Member

ctb commented Nov 15, 2014

Apart from that one comment, LGTM. Suggest waiting for @mr-c to take a look as he is more familiar with issues.

@@ -446,6 +451,7 @@ def test_normalize_by_median_dumpfrequency():
assert 'Nothing' in out


@attr('known_failing')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is an existing test now marked as a known failure?

@bocajnotnef
Copy link
Contributor Author

@mr-c: Resolved, methinks. All good?

Check status of file - return if file exists; warn and exit
if empty, or does not exist
"""
return
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This return disable the entire method

…n_failing since they fail with existing systems. non-gzip streaming works in screed 0.7.1
Cleaned up formatting in streaming tests.
Renamed streaming test helper functions to something more explicit.
Cleaned up fifo/blk testing logic structure to be cleaner
Added docstrings to helper functions to better explain functionality
Cleaned up some comments
Cleared up logical structure
removed extraneous known_failing attr
@bocajnotnef
Copy link
Contributor Author

Commit discontinuity due to forcing with a merge conflict fix.

@mr-c Asserts/spacing resolved.

mr-c added a commit that referenced this pull request Nov 16, 2014
added screed and read_parser streaming testing
@mr-c mr-c merged commit 91a0308 into master Nov 16, 2014
@mr-c mr-c deleted the testing/streaming branch November 16, 2014 20:17
@mr-c
Copy link
Contributor

mr-c commented Nov 16, 2014

Good job, @bocajnotnef !

@bocajnotnef
Copy link
Contributor Author

Yaaaay!

@mr-c mr-c restored the testing/streaming branch November 16, 2014 21:22
@mr-c
Copy link
Contributor

mr-c commented Nov 16, 2014

retest this please

@mr-c
Copy link
Contributor

mr-c commented Nov 16, 2014

please test this

def execute_abund_dist_single_streaming(ifilename, somedir=None):
'''Helper function for the matrix of streaming tests using screed via
filter-abund-single, i.e. uncompressed fasta, gzip fasta, bz2 fasta,
uncompressed fastq, etc.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also this comment is wrong (not using screed, wrong script name)

@mr-c mr-c deleted the testing/streaming branch April 15, 2015 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants