-
Notifications
You must be signed in to change notification settings - Fork 38
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
Server fixture #812
Server fixture #812
Conversation
@jgosmann, thanks for your PR! By analyzing the annotation information on this pull request, we identified @rsimmons1, @tbekolay and @tcstewar to be potential reviewers |
LGTM. |
This is a big improvement! One thing I noticed in the Travis build is that the selenium and GUI servers weren't closed and had to be killed. I ran this locally twice, and in once case Firefox remained open (which I assume means the selenium server was still up) and once it closed. This SO thread indicates that we should be using |
|
240645f
to
59f4e62
Compare
I made some commits to fix up the Should I make a separate PR for the TravisCI stuff and those fixes or keep doing here? |
I think those changes are necessary to make the changes functional, On Thu, Jul 28, 2016 at 4:31 PM, Trevor Bekolay notifications@github.com
|
The changes make local testing better and still pass in TravisCI, so definitely not necessary. But yeah, it also shouldn't take much to fix either so I'll look at it soon (just didn't want to hold up this PR if @tcstewar wanted to merge). |
e49fb38
to
7992d94
Compare
Since this PR hasn't moved I fixed up the Python 3 style, so (fingers crossed) this should now pass on Python 2 and 3. |
8c6fd01
to
7992d94
Compare
Awesome changes Trevor! I liked reviewing this pull request because it taught me a lot about TravisCI for Python. LGTM. |
Given the decision at the last dev meeting we should really get this PR merged @tcstewar as it's a big improvement to the testing infrastructure. |
Hmm, I get a seg fault, and it seems to require py.test==2.9.1 for me.... That could just be my computer having some broken things in it.... hmm.... I've got a few things I can try, though. Here's the not-all-that-informative seg fault (after firefox pops up and briefly shows the network...):
|
Never mind, it's just my computer -- I get the same seg fault in master. Grr.... |
Are you using a virtual environment? If so, that can happen if you've updated Python. Easiest fix is to wipe your virtual environments and remake them. |
Grr... same problem with a completely fresh virtual environment.... :( |
I think I had that problem once with sqlite not being linked to Python? Or maybe it was Tcl? In any case, probably have to reinstall Python :( |
You can see whether the |
This makes the test slightly faster. Also switch to driver.quit(), as driver.close() just closes the current web browser window. Since we now use a session scoped fixture, we should shut down the whole selenium server after the test session.
This allows to run all tests with a simple `py.test nengo_gui` without the need to start the server manually. It also automatically selects a free port allowing to run another nengo_gui server or other things on the default things in parallel (e.g. to work on an actual model while the tests run).
While much of this is to pass flake8 checks, in some instances there were tabs in these files, which Python 3 requires you to do very carefully. Since some lines had mixed tabs and spaces, the tests wouldn't run in Python 3. With these style fixes, tests run and pass in Python 3.
This makes the Nengo GUI TravisCI build more similar to Nengo's. A few important differences: - Tests on both Python 2 and 3. - Uses Miniconda instead of the built-in Python (should have a faster NumPy than the built-in). - Doesn't use `sudo` (allows us to use container infrastructure, which should make starting up builds much faster). - Doesn't start Nengo GUI server twice. - Doesn't install Chrome webdriver (since it's not used -- selenium comes with the Firefox driver and TravisCI has Firefox installed).
7992d94
to
16d8670
Compare
a54a484
to
4b90a0f
Compare
3b17bf0
to
b892f49
Compare
I took a look at this PR again since we talked about it a while back. I rebased it to master and cleaned up the history, but it failed on TravisCI because Selenium recently released version 3.0, which has a whole different Firefox webdriver. I tried to get that working, but it just wasn't happening (will make a separate PR for that), so I changed Anyway, it's worth merging now as it's a big improvement over the current state of things. I'll look into getting Selenium 3 working after lunch. |
Sounds good. Thanks for digging into this (I still haven't got it running on my machine, which is I think an indication that it's time to reinstall, as I'm pretty sure I've broken a bunch of things attempting to fix this)... I'll bring this into master now. :) |
This automatically starts the nengo_gui server for tests with a fixture. It allows to run the tests with a simple
py.test
and no need to start a server beforehand.It also automatically selects a free port allowing to run another nengo_gui server or other things on the default things in parallel (e.g. to work on an actual model while the tests run).