-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Fix/Improve Test Driver #721
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
Conversation
52b3e53
to
94b204e
Compare
Okay, I've refactored so that this can be merged before the XML one. |
@JukkaL I'm really not sure if I can solve the bug this exposes. I just investigated my hypothesis and it turned out to be fruitless. (An example of) The failing test is: Which is curious because this works and does result in an import of the But this doesn't work: This changes the error message: And this somehow works: So all I can really say is that this is some subtle ordering problem that is beyond my skill/knowledge. |
I added a list of XFAILs so at least we can get meaningful test results until the real bug is fixed. Also managed to find a non-racy way to run tasks in parallel without |
e9401c1
to
f04f262
Compare
Thanks for the PR! This is pretty big so it might take a while but I hope to have time to review it this weekend. |
Ugh, your recent pushes made there be conflicts. |
I've now merged your changes to the current master (haven't pushed them yet) and have been playing around with them a little. It's much better to run tests in parallel, type check all stubs and to have automatic test discovery! There are some regressions that shouldn't be difficult to fix or work around:
|
What I usually do is run If it's really worth running just a single unit test (since other than pythoneval, test modules are fast), I briefly experimented with Really,
Am I the only one who always runs test drivers in verbose mode? It's not like there is anything valuable in the terminal's scrollback, and the failures are nicely collected at the end. But I'm certainly not opposed to adding command-line options to travis.py to control it. I prefer immediate output because deferred output and log files can be problematic, though I admit that I am used to working in C and C++ where memory corruption and sudden exit are more common (though they're certainly possible in python also).
I deliberately did not name it Bikeshed alternative:
Currently, This PR is not an attempt to provide perfection, only an improvement. Ideally I think |
@JukkaL Can you please (rebase and) merge this? I have no clue what is acceptable to you, and you keep on giving painful delays. I'm almost done with the new parser (still need to finish expression parsing and port billions of unit tests), but for lowering I really need to be able to use the updated version of mypy. |
@o11c: Sorry for having being unresponsive; I've been out of the country for almost 3 weeks now and been very busy. Things will calm down next week. I may have a few hours later this week, but I can't promise anything. |
Note, there is a rebased version of this at https://github.com/o11c/mypy/tree/driver-rebased but I haven't investigated the new test failures yet. |
Okay, fixed. |
Okay, fixed. More cyclic import problems that probably should be fixed elsewhere, but ... explicit annotations will do for now. |
Rebased to fix another bug caused by upstream changes, and made the linter stop complaining. I really think the linter is being stupid for some of those things though. |
@JukkaL note that I still have to xfail 4 of the stubs, even though they are correct. Obviously there's still a cyclic import problem somewhere. |
Rebased on top of #903 for easier maintenance of my other branches. But seriously, this is embarrassing. |
@o11c: This PR has taken me a lot of work to review, and because it has sometimes felt like a burden it's also been slow. I've done some reflection and tried to understand why this happened and how we can make this less likely to happen in the future. Here are my thoughts: http://www.mypy-lang.org/wiki/GoodPullRequest Anyway, I'm going to do another round of review today and hopefully I can finally merge it. |
The current
travis.sh
is broken in a number of ways. This fixes most of them.Note: there are legitimate bugs exposed in mypy here, that's why the tests fail. The stubs do not appear to be incorrect.