Use wrap_child instead of replacing get_html - #945
Conversation
There was a problem hiding this comment.
It'd be nice to have more comments here explaining what's going on.
|
Test coverage seems a little low. And parts of the code are a bit mind-bending - as always more comments are appreciated to help those without such an intimate knowledge of what you're working on. Otherwise I don't see any particular glaring issues. |
|
There was a problem hiding this comment.
far gment? f arg ment? hehe this typo can be read in many ways
|
👍 by me |
There was a problem hiding this comment.
This doesn't look right: the if clause sets self.content, the else clause returns? Also, no return value is used from self.render(). Why is there even a self.render() at all? It doesn't seem to be overridden from a base class, and it's only called from a two-line method just above it. I probably missed something.
There was a problem hiding this comment.
No, you're quite right. I think the render method was based on a similar pattern used in other modules (with similar debatable utility). And yes, self.content vs return is clearly wrong.
This is the module I'm working on writing tests of now (because it has exactly 0), so I'm going to leave these in until the tests catch the issues.
|
OK, done with the review. None of my comments require re-review, merge when you've addressed whatever needs addressing. 👍 |
|
I'm not okay with including I'll take a closer look at this PR later tonight or early tomorrow to give feedback on the other test infrastructure changes. |
|
Thank you for cleaning up the factories -- I found your implementation much neater, but I think it could use a few more comments to explain what's going on. To expand on my earlier comment about changing coverage reporting, my main concern is this: We currently generate several coverage.py HTML reports (lms, cms, xmodule, capa, calc, etc.). If one source file is included in multiple test suites, then it will get reported multiple times, but with different numbers. This is currently how we handle common/djangoapps, and it's pretty confusing. I'm open to figuring out a better way to collect and report coverage data. One possibility would be to generate a single coverage.py report for edx-platform, so that each source file is reported only once. However, I'd want to get input from all the teams that would be affected (Studio, LMS, and Blades) before making such a big change. |
|
@wedaly: I reverted the change to the coverages. Regarding that, though. Would it make sense to collect coverage information on all edx-platform source code exercised in either of the LMS or CMS test suites, but then to report on on lms, cms, and the various common directories separately? (Meaning, if a line in LMS was only covered in a Studio test, it still counts as covered) |
|
The test that is failing is also failing on master. I'm merging this PR. |
Use wrap_child instead of replacing get_html
@nedbat, @sarina: Review, once #909 is applied?
@wedaly: I added some test infrastructure, and made lms/cms tests add to the common/lib coverage. Can you review that?
Things to review: