Skip to content

Speedup metadata tests #1033

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

Merged
merged 11 commits into from
Apr 2, 2015
Merged

Conversation

josenavas
Copy link
Contributor

Fixes one item from #1029

Splits the metadata template tests between DB read only tests and DB read write tests (so it saves time since it does not have to rebuild the database in each test).

I just wanted to move tests around, but I fixed a couple of small issues:

  • MetadataTemplate no longer has a create function so I removed the test (it was a leftover)
  • to_dataframe is not a classmethod so it does not need the _check_subclass class and by extension it does not need a test on MetadataTemplate
  • Delete did not had the call to _check_subclass, so I added it and a test on MetadataTemplate

Since this is a performance PR, some times:

Now:

$ nosetests qiita_db/metadata_template/test/
............../Users/jose/qiime_software/QiiTa/qiita_db/metadata_template/util.py:103: QiitaDBWarning: Sample names were already prefixed with the study id.
  QiitaDBWarning)
../Users/jose/qiime_software/QiiTa/qiita_db/metadata_template/util.py:103: QiitaDBWarning: Sample names were already prefixed with the study id.
  QiitaDBWarning)
....................................................................................................................................................
----------------------------------------------------------------------
Ran 164 tests in 61.491s

OK

Before:

$ nosetests qiita_db/metadata_template/test/
......................................./Users/jose/qiime_software/QiiTa/qiita_db/metadata_template/util.py:103: QiitaDBWarning: Sample names were already prefixed with the study id.
  QiitaDBWarning)
../Users/jose/qiime_software/QiiTa/qiita_db/metadata_template/util.py:103: QiitaDBWarning: Sample names were already prefixed with the study id.
  QiitaDBWarning)
............................................................................................................................
----------------------------------------------------------------------
Ran 165 tests in 163.808s

OK

Any future PR on the metadata template depends on this one, since this reduces developer time (less time on tests, more time coding), so a fast review/merge is appreciated.

@antgonza
Copy link
Member

antgonza commented Apr 2, 2015

👍 if tests pass

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.02%) to 79.22% when pulling d900e7b on josenavas:speedup-metadata-tests into 0a04779 on biocore:master.

class TestPrepSample(TestCase):
"""Tests the PrepSample class"""

class SetUpTestPrepSample(TestCase):
Copy link
Contributor

Choose a reason for hiding this comment

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

Very minor but it took me a little while to realize that SetUpTestPrepSample was a base class for TestPrepSample, maybe it would be better to change the name to be BaseTestPrepSample?

@ElDeveloper
Copy link
Contributor

👍 looks really good.

Thanks for adding such nice description to the PR, as a reviewer it makes it a lot easier to know upfront what are the specifics that you'll be looking at.

@josenavas
Copy link
Contributor Author

Done, thanks!

Yeah, I think if we are all starting doing this, specially in "complex" PR, it will facilitate the reviewer work.

@ElDeveloper
Copy link
Contributor

👍, excellent, ready to be merged as soon as tests complete.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.02%) to 79.22% when pulling 0e6c86d on josenavas:speedup-metadata-tests into 0a04779 on biocore:master.

antgonza added a commit that referenced this pull request Apr 2, 2015
@antgonza antgonza merged commit 9068d4c into qiita-spots:master Apr 2, 2015
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.

4 participants