Trouble running the unit tests

40 views
Skip to first unread message

Jeff Brantley

unread,
Feb 25, 2018, 4:03:32 PM2/25/18
to Beancount
I want to try running the unit tests on Windows (native), but first, I thought it wise to run them on Ubuntu to make sure I knew how to run them, and to get a baseline idea of how many tests are supposed to run and whether they are all passing. The first problem I'm hitting is that the suite stalls after 302 tests at test_extract_examples, railing out a CPU core and running indefinitely (at least a couple minutes before I killed it).

Before I attempt to debug the test---which employs some amount of indirection to call out to a main function---I wanted to ask about two things:

1. Is this a known or expected problem?
2. Under what conditions/environment do I need to run the test? Or, Martin, what do you do, and how flexible is that?

In a nutshell (details later), my current setup involves a proper Ubuntu 17.10 in a VM (not WSL), installing from source into a virtualenv, and then invoking nosetests against the installation (not the repo). Trying it against the repo yielded a bunch of errors that I did not investigate for now. Is this a reasonable arrangement? What is the appropriate setup for running these tests?

Details:
Ubuntu 17.10 Desktop 64-bit running in VMWare Player
Existing packages updated.
Installed Python: 3.6.3
sudo apt install python3-venv python3-pip python3-dev
Setup a python virtualenv using python3 -m venv ENVNAME
With the virtual environment activated:
pip install wheel (to avoid gripes about unable to build local wheels of dependencies)
pip install nose
cd path/to/repo/beancount
pip install .
cd path/to/elsewere
nosetests -v beancount

Jeff Brantley

unread,
Feb 25, 2018, 10:20:59 PM2/25/18
to Beancount
Ok, I tried something closer to Martin's notes in Installing Beancount. I made a new virtual env, pip-installed the dependencies listed in setup.py, and then modified PATH to point to <repo>/bin and PYTHONPATH to include <repo>. Then, from a separate directory, I tried invoking nose again. I did not see the hang, and all non-skipped tests passed.

Mildly disappointing that I can't run the tests against installed beancount, but awesome that there is a large battery of tests and they are runnable, and they pass!

Martin Blais

unread,
Feb 25, 2018, 10:29:52 PM2/25/18
to Beancount
On Sun, Feb 25, 2018 at 4:03 PM, Jeff Brantley <jsb...@gmail.com> wrote:
I want to try running the unit tests on Windows (native), but first, I thought it wise to run them on Ubuntu to make sure I knew how to run them, and to get a baseline idea of how many tests are supposed to run and whether they are all passing. The first problem I'm hitting is that the suite stalls after 302 tests at test_extract_examples, railing out a CPU core and running indefinitely (at least a couple minutes before I killed it).

Before I attempt to debug the test---which employs some amount of indirection to call out to a main function---I wanted to ask about two things:

1. Is this a known or expected problem?

No. It would be nice to know why it fails.

 
2. Under what conditions/environment do I need to run the test? Or, Martin, what do you do, and how flexible is that?

Should be pretty vanilla, not sure what's the issue.


In a nutshell (details later), my current setup involves a proper Ubuntu 17.10 in a VM (not WSL), installing from source into a virtualenv, and then invoking nosetests against the installation (not the repo). Trying it against the repo yielded a bunch of errors that I did not investigate for now. Is this a reasonable arrangement? What is the appropriate setup for running these tests?

Reasonable arrangement is just the dependencies for Beancount + nosetests and it ought to work.


Details:
Ubuntu 17.10 Desktop 64-bit running in VMWare Player
Existing packages updated.
Installed Python: 3.6.3
sudo apt install python3-venv python3-pip python3-dev
Setup a python virtualenv using python3 -m venv ENVNAME
With the virtual environment activated:
pip install wheel (to avoid gripes about unable to build local wheels of dependencies)
pip install nose
cd path/to/repo/beancount
pip install .
cd path/to/elsewere
nosetests -v beancount

--
You received this message because you are subscribed to the Google Groups "Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beancount+unsubscribe@googlegroups.com.
To post to this group, send email to bean...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/b5cff530-76b8-4a59-9e7c-8126c1daa952%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Michael Droogleever

unread,
Feb 27, 2018, 12:01:38 PM2/27/18
to Beancount
Just to add in case anyone else comes across this:

You probably want to use `pip install -e ./path/to/beancount` if installing from a repo (see editable install)

And Nose is deprecated as far as I know, but pytest is a replacement which is compatible with unittest and nose, and works for me:
`pip install pytest`

Jeff Brantley

unread,
Feb 27, 2018, 11:46:54 PM2/27/18
to Beancount
Thanks for sharing, Michael. I'll have to check those out when I get a chance. Do you know whether the -e option plays well with the C extension?

For now, I'm able to run the suite on Windows using the same basic approach as above. It's a total bloodbath. =) I'm still gathering up a list of failed tests to sort through, but I filed a couple issues so far that seemed pretty pervasive. I'm hoping the list of underlying causes will turn out to be short.
Reply all
Reply to author
Forward
0 new messages