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

[MRG] Changing sourmash compute to sourmash sketch in tests/test_sourmash.py #1536

Merged
merged 9 commits into from
May 22, 2021

Conversation

keyabarve
Copy link
Contributor

@keyabarve keyabarve commented May 19, 2021

Addresses #1419

@keyabarve
Copy link
Contributor Author

@ctb I have changed the function test_do_compare_quiet and it passes, but when I tried to change test_do_compare_output_csv, both the following commands worked and the test passed:

  • c.run_sourmash('sketch', 'rna', '-p', 'k=31,num=500', testdata1, testdata2)
  • c.run_sourmash('sketch', 'dna', '-p', 'k=31,num=500', testdata1, testdata2)
    Which one of these is correct? How can we know?

@codecov
Copy link

codecov bot commented May 19, 2021

Codecov Report

❗ No coverage uploaded for pull request base (latest@e33738a). Click here to learn what that means.
The diff coverage is n/a.

❗ Current head e0c1a58 differs from pull request most recent head c8fb109. Consider uploading reports for the commit c8fb109 to get more accurate results
Impacted file tree graph

@@            Coverage Diff            @@
##             latest    #1536   +/-   ##
=========================================
  Coverage          ?   95.20%           
=========================================
  Files             ?       99           
  Lines             ?    17553           
  Branches          ?     1600           
=========================================
  Hits              ?    16711           
  Misses            ?      609           
  Partials          ?      233           
Flag Coverage Δ
python 95.20% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e33738a...c8fb109. Read the comment docs.

@keyabarve
Copy link
Contributor Author

Please review. @ctb

Copy link
Contributor

@ctb ctb left a comment

Choose a reason for hiding this comment

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

Looks good so far! A few requests -

  • please don't say "Fixes XXX" in the top comment, since that will close the issue completely. Say "Fixes a few tests per issue XXX". This is special for repeatable quest issues; we will only close them when all of the codebase has been changed.
  • could you update from latest, too?

@@ -198,7 +198,8 @@ def test_do_basic_compare_using_rna_arg(c):
def test_do_compare_quiet(c):
testdata1 = utils.get_test_data('short.fa')
testdata2 = utils.get_test_data('short2.fa')
c.run_sourmash('compute', '-k', '31', testdata1, testdata2)
# c.run_sourmash('compute', '-k', '31', testdata1, testdata2)
Copy link
Contributor

Choose a reason for hiding this comment

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

please do remove the commented out line ;).


# In the lines below, 'rna' and 'dna' both pass the tests. How do we know which one is correct here?
# c.run_sourmash('sketch', 'rna', '-p', 'k=31,num=500', testdata1, testdata2)
# c.run_sourmash('sketch', 'dna', '-p', 'k=31,num=500', testdata1, testdata2)
Copy link
Contributor

Choose a reason for hiding this comment

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

rna and dna currently do exactly the same thing. I would suggest using dna.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay!

@keyabarve
Copy link
Contributor Author

Please review. @ctb

Copy link
Contributor

@ctb ctb left a comment

Choose a reason for hiding this comment

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

Looks good! I'm updating from latest & when it finishes, please go ahead and merge.

@ctb ctb changed the title [WIP] Changing sourmash compute to sourmash sketch in tests/test_sourmash.py [MRG] Changing sourmash compute to sourmash sketch in tests/test_sourmash.py May 21, 2021
@keyabarve
Copy link
Contributor Author

I still need to change more tests. There are quite a few actually.

@ctb
Copy link
Contributor

ctb commented May 21, 2021

I still need to change more tests. There are quite a few actually.

I know, but you should leave them for others!

@keyabarve
Copy link
Contributor Author

Okay! I actually changed 2 more tests but didn't push, should I go ahead and push it and then we can merge?

@keyabarve
Copy link
Contributor Author

@ctb I can't seem to figure out why one of the checks is failing.

@ctb
Copy link
Contributor

ctb commented May 21, 2021

@ctb I can't seem to figure out why one of the checks is failing.

it's not your fault; sonarcloud is a flaky thing. but there IS a merge conflict to deal with - see https://www.simplilearn.com/tutorials/git-tutorial/merge-conflicts-in-git (for example), and if you want to give it a try, do

git pull origin latest

on this branch and then work to resolve the conflicts.

@keyabarve
Copy link
Contributor Author

Okay, I'll try it out!

@ctb ctb merged commit ee4a8a8 into latest May 22, 2021
@ctb ctb deleted the KB_1419 branch May 22, 2021 00:05
@@ -348,8 +351,8 @@ def test_do_compare_output_multiple_k(c):
def test_do_compare_output_multiple_moltype(c):
testdata1 = utils.get_test_data('short.fa')
testdata2 = utils.get_test_data('short2.fa')
c.run_sourmash('compute', '-k', '21', '--dna', testdata1)
c.run_sourmash('compute', '-k', '63', '--no-dna', '--protein', testdata2)
Copy link
Member

Choose a reason for hiding this comment

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

Why did the 63 has changed to 21? Was it wrong in the first place? thanks.

Copy link
Contributor Author

@keyabarve keyabarve May 28, 2021

Choose a reason for hiding this comment

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

I changed 63 to 21 because the test wasn't passing if I did c.run_sourmash('sketch', 'translate', '-p', 'k=63,num=500', testdata2). Only when I changed it to c.run_sourmash('sketch', 'translate', '-p', 'k=21,num=500', testdata2), the test was able to pass.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure if it was wrong in the first place.

Copy link
Member

Choose a reason for hiding this comment

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

Hi Keya, thanks. I don't know if this an issue or not. I just spotted that change while taking a look at the PR. We can ask Titus @ctb

Copy link
Contributor

Choose a reason for hiding this comment

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

great question! this changed in 4.0.

per release notes, changed behavior:

Copy link
Member

Choose a reason for hiding this comment

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

That makes sense! Thanks @ctb

@luizirber
Copy link
Member

it's not your fault; sonarcloud is a flaky thing.

A warning here: sonarcloud is not a required check (we can merge PRs even if it fails), but it shouldn't be ignored by PR reviewers. Sometimes it does find real bugs, although it is "flaky" in the sense that it complains about repetitive code (which we do have a lot in tests/, on purpose.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants