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

unit testing #34

Closed
dustinvtran opened this issue Mar 5, 2016 · 14 comments
Closed

unit testing #34

dustinvtran opened this issue Mar 5, 2016 · 14 comments
Assignees
Labels

Comments

@dustinvtran
Copy link
Member

Start formalizing unit testing procedure. #1 also relevant

@dawenl
Copy link
Member

dawenl commented Mar 7, 2016

That's a good way to remind me :)

@ido
Copy link

ido commented Mar 9, 2016

  1. Think about setting up a .travis.yml for travis-ci or jenkins to compile (n/a yet) and run tests.
  2. Write regression tests (e.g. in pytest or nose) that run all current examples and verify breakage.
  3. Add unit tests (e.g. in pytest or nose) for distributions, variationals, models, etc. as necessary

@dawenl
Copy link
Member

dawenl commented Mar 9, 2016

I think nose would be a good option here (I also have more experience with it).

@dustinvtran
Copy link
Member Author

I have experience with none of the above. You have dictatorial status on this @dawenl :)

@ido
Copy link

ido commented Mar 9, 2016

@dawenl: From the nose webpage I linked: "New projects should consider using Nose2, py.test, or just plain unittest/unittest2." Good luck! You may need @dustinvtran to set up Travis-CI once you create a .travis.yml file (or whoever is an admin/owner of the blei-lab GH org).

@akucukelbir
Copy link
Contributor

@dawenl what's wrong with https://docs.python.org/2/library/unittest.html ?

@dustinvtran
Copy link
Member Author

Fyi @dawenl: Alp's unit tests (https://github.com/Blei-Lab/blackbox/blob/master/tests/test_check_is_tf_vector.py; https://github.com/Blei-Lab/blackbox/blob/master/tests/test_log_sum_exp.py) use the above library. Mine is bad in that it just prints stuff. Totally up to you on the framework to choose and then making that change to all the current unit tests.

@dawenl
Copy link
Member

dawenl commented Mar 11, 2016

@akucukelbir It's just I've been using nosetest for some of my other projects (but looks like now we should switch to nose2), and as far as I know nose is based on unittest with more convenient support and API.

@akucukelbir
Copy link
Contributor

@dawenl okay sounds good. let's go with whatever you decide. just point us to a nice example once you're done, so that we can write new tests in a similar style. (awesome!)

@dawenl
Copy link
Member

dawenl commented Mar 13, 2016

After some initial investigation, it seems that nose2 dropped some of commonly used functions by me (e.g. assert_raises, eq_, etc.) back to unittest, so the unit tests written by @akucukelbir would work perfectly fine with nose2. I am re-writing some of the tests by @dustinvtran but overall there will not be a lot of work here.

@dawenl dawenl mentioned this issue Mar 14, 2016
@dawenl
Copy link
Member

dawenl commented Mar 14, 2016

oops, looks like travis.CI will only work for free if the project is public. @dustinvtran any thoughts?

@ido
Copy link

ido commented Mar 14, 2016

CircleCI is an alternative.

On Mar 14, 2016, at 01:14, Dawen Liang notifications@github.com wrote:

oops, looks like travis.CI will only work for free if the project is public. @dustinvtran any thoughts?


Reply to this email directly or view it on GitHub.

@dustinvtran
Copy link
Member Author

@dawenl Sure that's okay. Let's integrate travis once we release it publicly then.

@dustinvtran
Copy link
Member Author

Now that we decided on a framework and most of the unit tests have been converted, I vote this issue being solved. We can discuss unit testing robots in #1 (and robots in general :).

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

No branches or pull requests

4 participants