Repository navigation
Adapt ipython tools for testing pull requests - #752
Conversation
…licitly add the dist-packages path under /usr/local to import nose
|
Test results for commit 773c75b merged into master (3fc2ba9)
|
|
Very happy to see you guys using our tools! Let us know if anything needs clarification, and conversely, please send any upates/improvements our way :) |
…So we catch the exception if the pull request breaks 'import networkx as nx'
…n to the log, see networkx#753 .
|
@fperez One of the things that I like of test_pr and friends is their simplicity, by reading the code you get a clear idea of what is going on. When our adaptation is merged and has settled down I will put together a pull request with all the changes that could also benefit ipython's test_pr. @Carreau we used pygithub for the migration trac -> github. It is under active development and has a lot of functionality, but is still not well documented and is rather big and complex compared with In the future might make sense to create a project to abstract and generalize this kind of script and create a proper standalone program (if I recall correctly @Carreau suggested that at scipy2012). Other projects, such as @sympy have the sympy-bot for testing pull requests which creates very nice reviews. I still like test_pr.py better because it is small, simple and gets the job done. Thanks for |
|
The test_pr.py script isn't working for me - maybe I'm missing something? |
|
@hagberg: I think you need a newer version of |
|
OK - I figured it out. My Ubuntu installation had an old/different version of the "requests" package. But I don't have a PYTHONPATH set and it breaks looking for that: These are small things but we should update the script to work (or break gracefully) in these cases. I have a stock Ubuntu 12.04 install. |
|
Yes, I forgot to mention that. The |
|
.text was added in 0.10.0, it seems, while precise has 0.8.2. I don't know |
|
I added the I also added a check for requests version and if our requirements are not met the script exits with an informative message. |
|
On Sun, Aug 12, 2012 at 2:11 PM, Jordi Torrents [email protected]:
Yes, maybe we should take the pypy part out if it adds that complexity of
|
|
Test results for commit 8088d2e merged into master (3fc2ba9)
|
|
On Sun, Aug 12, 2012 at 9:34 AM, Jordi Torrents [email protected]:
I completely agree. I think it's OK to beat the tools up a little
|
|
Note that this might make some of this work easier, and moreover, instead of fetching That's actually how github does test how |
|
@Carreau, that is very nice. I didn't know you could do that. It is very useful for easily fetching pull requests. I still don't have a good understanding of git, so I don't have an informed opinion of the changes that you propose. But I will port any changes that you guys do on ipython's |
I dont know git well neither, I discovered it by mistake by mistyping what was in the gist. I think that you could It should decrease the required bandwidth a lot. |
|
NetworkX: Test results for pull request #752
|
|
Finally I've found some time to work on this. I've improved the reports from tests in order to be clearer, they caused some confusion (see #762). As Chris (@chebee7i) noted, posting tests results that pass as github comments (as I just did above) can give a false sense of security. We could adopt the convention of only posting the result of the script if there is some failure ( |
|
I think it's quite important to post on success, so that everyone can see that the PR was tested before it was merged. Scanning through #762, it looks like the confusion just relates to the wording 'merged into master', so maybe that can be adjusted. Then again, I don't think we've had the same confusion in IPython, so maybe it was a one off. |
|
2012/9/23 Thomas Kluyver [email protected]
Yes, the confusion was mostly related to the report's wording. Maybe By the way, what do you think of the changes in the report? If you |
|
In fact, I think your wording is already clearer in the report above: "This pull request can be merged clearly..." (although I think it should say 'cleanly', not clearly). I like the little icons - I assume there's a different icon for a failure? I'm not so sure about the branch description line, it seems to duplicate information already in the PR, although I know there's not a link to the repository. Maybe it should be integrated into the title: "...pull request #752 (jtorrents 'tools' branch)" |
|
2012/9/23 Thomas Kluyver [email protected]
Ok, these changes sound good to me, I'll do them shortly (after lunch |
|
NetworkX: Test results for pull request #752 (jtorrents 'tools' branch)
|
|
NetworkX: Test results for pull request #752 (jtorrents 'tools' branch)
|
|
Implemented the changes suggested by Thomas. I also posted a message of a non mergeable pull request. It asks explicitly to rebase form |
|
Doesn't git default to calling the clone source 'origin', rather than 'upstream'? I guess that doesn't work if you cloned from your own Github fork, though. Can the rebase command use a remote repository URL? |
|
NetworkX: Test results for pull request #752 (jtorrents 'tools' branch)
|
|
2012/9/23 Thomas Kluyver [email protected]
I think it is not possible to add a remote repository URL with the |
|
On Sun, Sep 23, 2012 at 8:34 AM, Jordi Torrents [email protected]:
If we're still using the 'upstream' language, we need to fix that. That Sorry if our outdated docs led you astray... |
|
2012/9/23 Fernando Perez [email protected]
I wrote ipython documentation but I was actually referring to numpy However there are still references to |
|
On Sun, Sep 23, 2012 at 3:01 PM, Jordi Torrents [email protected]:
By name: I now refer to 'origin' for all projects' main repos, and use That approach has the advantage that copy/pasting snippets that github I think the numpy instructions were created back when we thought of the |
Adapt ipython tools for testing pull requests
@ipython has a very nice set of tools for their github based development workflow. See:
https://github.com/ipython/ipython/tree/master/tools
As @fperez suggested at SciPy 2012, it is easy and useful to adapt some of them for NetworkX development. This pull request adapts the test_pr.py script and friends for NetworkX. It automatically tests pull requests (using virtualenv and downloading the code directly from github) and optionally posts the results as a comment in the pull request page (including a link to a gist with the log for failed tests). It is a very nice and useful tool. For the origunal ipython pr_test.py see:
https://github.com/ipython/ipython/blob/master/tools/test_pr.py
I did some changes on how the tests are run inside each virualenv. IPython uses a script for running tests which is installed at the 'bin' directory of each virtialenv. But I think it is easier for NetworkX tests to simply use check_output:
I also added PyPy support (last commit). But I'm not sure if it will work in something different than a Debian based system. PyPy and virtualenv play nice together and no significative change in the code is required, but in Debian/Ubuntu systems the option
--system-site-packagesof virtialenv does not add the actual dist-packages path for pypy (/usr/local/lib/pypy2.7/dist-packages). As a quick and dirty solution, I've opted for adding the path explicitly inrun_tests()to be able to import nose, but it is not a solid solution. So more work is needed. I'll be quite busy the next days and I'm not sure if I will be able to work on this, so I'm posting it hoping than someone can take a look, test it in other systems and also work on it.This script assumes that there is a directory named
.nx_pr_testsin your home directory and that the nose package and other libraries are installed system wide in each python environment. It does not import anything from the user defined$PYTHONPATH.