Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Improve robustness and debuggability of test suite #13

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

Closed
ipython opened this issue May 10, 2010 · 8 comments
Closed

Improve robustness and debuggability of test suite #13

ipython opened this issue May 10, 2010 · 8 comments
Milestone

Comments

@ipython
Copy link
Collaborator

ipython commented May 10, 2010

Original Launchpad bug 508971: https://bugs.launchpad.net/ipython/+bug/508971
Reported by: fdo.perez (Fernando Perez).

This bug is a follow-up of:

https://bugs.launchpad.net/ipython/+bug/362142

which is now closed and split into several more specific reports. See the above for extra background.

The main points brought up by Brian:

Our test suite is still quite fragile and difficult to debug when things go wrong (case in point, your recent bug report about the history being dumped to the screen). If we can get the dpendency issues worked out (to isolate twisted and nose) I think most of this fragility is localized to the nose extension that handles the one time IPython shell. I think our test infrastructure has to be completely independent of our main IPython code (the testing infrastucture should never do "from IPython import ...").

At some point, we figured out how we could enable the writing of IPython doctests without the nose extension (do you remember how this can be done?). As I remember we talked about using this idea along with pexpect to isolate the running IPython to another process.

Jorgen noted:

I think using pexpect requires some research if you want to keep the the
tests running on windows.

Brian's reply:
Yes, this is a huge problem - pexpect doesn't work on Windows...

We should check with the Sage folks, I know at one point, they were working on a windows port of pexpect called wexpect.

Twisted does have many of the same capabilities that pexpect has for working with external processes. That might be our best bet.

@ipython
Copy link
Collaborator Author

ipython commented May 10, 2010

[ LP comment 1 by: Fernando Perez, on 2010-01-18 01:39:06.370752+00:00 ]

Some notes on the above:

  • I talked with William Stein (sage) a few days ago: no major progress from them on using pexpect for windows, instead they are moving away from pexpect as much as possible by building library wrappers for everything they can (like maxima and gap).
  • I don't see us abandoning nose anytime soon. Trial has a few critical problems:
  • it would make testing depend on twisted for us. Nose is a tiny, self-contained download, but Twisted is a much larger dependency. Too much for something as critical as testing.
  • It has no discovery mechanism for doctests.
  • My earlier efforts on doing ipython doctests without nose were only partly successful. In the last few weeks that I've been working a lot on this, I realized we really need quite a bit of machinery to be able to validate full ipython sessions, just doing syntax conversion to get a unittest out of a docstring (the part I was able to succeed on) isn't sufficient for the whole test suite.

I don't think it's really possible to expect our test suite to pass without an ipython shell running somewhere. We are more than just plain python, and to test all of that we really need a true ipython somewhere that we can beat on.

Having said all this, I think things now aren't really that bad. Having cleaned up the test machinery a lot recently, it's working quite well, debugging is possible with --pdb or other mechanisms, etc. The only thing that is hard is debugging a big doctest with lots of output, but that's simply how doctests are, not something specific to ipython (and for that reason, a bad idea in general if you want your tests to be debuggable).

I'm all for making our testing machinery as simple/robust as humanly possible, because I fully realize the importance of the test support in the health of a project. But having spent literally upwards of a hundred hours on this problem alone, I'm not sure right now I'm capable of making it much simpler without writing something like nose again, from scratch.

One ray of light may come from python itself: I think for 2.7 they are improving unittest, so perhaps we could find better support there once it's out.

I'm open to revisiting this question when possible, but I'm not terribly optimistic on me making lots of improvements beyond what's right now in my trunk-dev branch (which actually works quite well, it must be said). But I'd love to see someone who comes with a fresh eye on this problem make progress on it!

@ellisonbg
Copy link
Member

If we get rid of Twisted using code in 0.11, that would simplify our testing significantly as we would not have to much with iptest.

@fperez
Copy link
Member

fperez commented Apr 8, 2011

@ellisonbg, ok if we close this one? I think we've made already a ton of improvements to iptest and it's reasonably usable now. This bug is sort of an open ended 'make testing better', so I think we have done that much. We can obviously do better and always keep improving, but at this point I'd rather have new bugs for specific changes/fixes rather than an open-ended one like this.

@ellisonbg
Copy link
Member

@fperez: I think the only thing that we should do before the 0.11
release is to go through and remove old testing code that is not being
used. I agree that things are much better now that twisted/trial are
out of the way. But I still find the testing subpackage to be a bit
of a tangle. But if you don't want to do this for 0.11 I totally
understand as it doesn't affect users.

On Fri, Apr 8, 2011 at 9:38 AM, fperez
[email protected]
wrote:

@ellisonbg, ok if we close this one?  I think we've made already a ton of improvements to iptest and it's reasonably usable now.  This bug is sort of an open ended 'make testing better', so I think we have done that much.  We can obviously do better and always keep improving, but at this point I'd rather have new bugs for specific changes/fixes rather than an open-ended one like this.

Reply to this email directly or view it on GitHub:
#13 (comment)

Brian E. Granger
Cal Poly State University, San Luis Obispo
[email protected] and [email protected]

@fperez
Copy link
Member

fperez commented Apr 8, 2011

On Fri, Apr 8, 2011 at 11:26 AM, ellisonbg
[email protected]
wrote:

@fperez: I think the only thing that we should do before the 0.11
release is to go through and remove old testing code that is not being
used.  I agree that things are much better now that twisted/trial are
out of the way.  But I still find the testing subpackage to be a bit
of a tangle.  But if you don't want to do this for 0.11 I totally
understand as it doesn't affect users.

Sounds good, we'll leave this open for one last cleanup pass, and will
then close it.

After that, we can open targeted issues for specific improvements to
the test system as we find problems or have ideas.

But this may not happen for 0.11...

f

@takluyver
Copy link
Member

I think #324 essentially states the same issue that this is being left open for - do we want to close one or the other?

@minrk
Copy link
Member

minrk commented Jun 24, 2011

As described in the comments, we aren't blocking 0.11 on this and #324 represents the only part we might get to in 0.11, so I'm re-designating as 0.12.

@fperez
Copy link
Member

fperez commented Apr 15, 2012

I'm inclined to close this, as I think at this point it's basically a vague 'make the test suite better'. I'm not saying the test suite is perfect, but obviously anything can always be improved. But we've cleaned up our test code quite a bit since this was first opened, and at this point I simply don't know what concrete action this issue suggests, so my vote is to simply close it. Over-generic issues without a concrete metric for success are in practice more or less noise in the tracker, as they can never be truly satisfied.

If anyone wants to reopen this, please do so with specific information on what needs to be done to consider it fixed. Because right now, our test suite is fairly robust, it can be easily debugged with the standard nose tools, etc. So any reopen should be really very specific (and perhaps be made as a new issue).

@fperez fperez closed this as completed Apr 15, 2012
minrk referenced this issue in minrk/ipython Jul 1, 2013
Fix basichtml... Open it again to further clean discussion
minrk added a commit that referenced this issue Jun 22, 2015
restrict login redirect to notebook app

closes #8314
takluyver pushed a commit that referenced this issue Aug 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants