You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mesos.apache.org by Charles Reiss <wo...@gmail.com> on 2012/04/20 22:48:34 UTC

Re: Review Request: Python Testcases for Webui

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/4823/#review7091
-----------------------------------------------------------


General issues:
- We don't seem to have an official Python style guide (oops?), but try to follow some approximation of the Google python style guide but with 2-space indent (as this seems to be roughly what other python files use). In particular, this means: wrap lines of more than 80 chars; blank line between methods in classes; two blank lines before top-level declarations
- Move tests to src/webui/tests or src/tests/webui
- Add a script that runs the tests, and it as a test with if WEBUI \ TESTS += <the script> \ endif -or- 
- Add all new files to EXTRA_DIST (or another automake-managed target) in Makefile.am (look at how other test files are currently added). When you're done 'make distcheck' from the top-level (warning: takes a long time) should not fail.



src/webui/common/run_testcases.py
<https://reviews.apache.org/r/4823/#comment15700>

    Why?



src/webui/common/run_testcases.py
<https://reviews.apache.org/r/4823/#comment15694>

    Try TestMaster or similar (unless you've integrated a coverage analysis).



src/webui/common/run_testcases.py
<https://reviews.apache.org/r/4823/#comment15697>

    Include the exception with the failure or rethrow it (and elsewhere).



src/webui/common/testcases.py
<https://reviews.apache.org/r/4823/#comment15695>

    Shouldn't we use a string literal that might be returned by the master?



src/webui/common/webui_lib.py
<https://reviews.apache.org/r/4823/#comment15696>

    I'm guessing this won't handle daylight saving transitions correctly.



src/webui/master/index.tpl
<https://reviews.apache.org/r/4823/#comment15701>

    Move logic so we can do framework['max_share']


- Charles


On 2012-04-20 08:36:23, terencekwt wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/4823/
> -----------------------------------------------------------
> 
> (Updated 2012-04-20 08:36:23)
> 
> 
> Review request for mesos and Charles Reiss.
> 
> 
> Summary
> -------
> 
> Python Testcases for webui
> 
> *added unit testcases for checking if the webui could break by inputing artificial test jsons
> *should catch bugs if there syntax issues, or general cases where resources doesn't add up correctly
> *moved most of the logic out of the bottle .tpl template file and into the common webui_lib.py
> 
> 
> This addresses bug MESOS-93.
>     https://issues.apache.org/jira/browse/MESOS-93
> 
> 
> Diffs
> -----
> 
>   src/webui/common/run_testcases.py PRE-CREATION 
>   src/webui/common/testcases.py PRE-CREATION 
>   src/webui/common/webui_lib.py 0c56fde 
>   src/webui/master/framework.tpl b29d2da 
>   src/webui/master/index.tpl 68ae313 
>   src/webui/slave/executor.tpl dd53464 
>   src/webui/slave/framework.tpl 9488da5 
>   src/webui/slave/index.tpl b2e2097 
> 
> Diff: https://reviews.apache.org/r/4823/diff
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> terencekwt
> 
>


Re: Review Request: Python Testcases for Webui

Posted by te...@berkeley.edu.

> On 2012-04-20 20:48:34, Charles Reiss wrote:
> > src/webui/common/run_testcases.py, line 20
> > <https://reviews.apache.org/r/4823/diff/1/?file=103457#file103457line20>
> >
> >     Try TestMaster or similar (unless you've integrated a coverage analysis).

Done renaming.


> On 2012-04-20 20:48:34, Charles Reiss wrote:
> > src/webui/common/run_testcases.py, line 40
> > <https://reviews.apache.org/r/4823/diff/1/?file=103457#file103457line40>
> >
> >     Include the exception with the failure or rethrow it (and elsewhere).

Done adding what Exception is thrown.


> On 2012-04-20 20:48:34, Charles Reiss wrote:
> > src/webui/common/webui_lib.py, line 87
> > <https://reviews.apache.org/r/4823/diff/1/?file=103459#file103459line87>
> >
> >     I'm guessing this won't handle daylight saving transitions correctly.

Should I just take out the time check then? It is not very crucial anyway to check this.


> On 2012-04-20 20:48:34, Charles Reiss wrote:
> > src/webui/master/index.tpl, lines 174-181
> > <https://reviews.apache.org/r/4823/diff/1/?file=103461#file103461line174>
> >
> >     Move logic so we can do framework['max_share']

Logic is moved to webui_lib, and is stored as a list of max_shares.


- terencekwt


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/4823/#review7091
-----------------------------------------------------------


On 2012-04-30 00:52:34, terencekwt wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/4823/
> -----------------------------------------------------------
> 
> (Updated 2012-04-30 00:52:34)
> 
> 
> Review request for mesos and Charles Reiss.
> 
> 
> Summary
> -------
> 
> Python Testcases for webui
> 
> *added unit testcases for checking if the webui could break by inputing artificial test jsons
> *should catch bugs if there syntax issues, or general cases where resources doesn't add up correctly
> *moved most of the logic out of the bottle .tpl template file and into the common webui_lib.py
> 
> 
> This addresses bug MESOS-93.
>     https://issues.apache.org/jira/browse/MESOS-93
> 
> 
> Diffs
> -----
> 
>   src/webui/tests/testcases.pyc PRE-CREATION 
>   src/webui/tests/run_testcases.sh PRE-CREATION 
>   src/webui/tests/testcases.py PRE-CREATION 
>   src/webui/slave/index.tpl b2e2097 
>   src/webui/tests/run_testcases.py PRE-CREATION 
>   src/webui/slave/executor.tpl dd53464 
>   src/webui/slave/framework.tpl 9488da5 
>   src/webui/master/framework.tpl b29d2da 
>   src/webui/master/index.tpl 68ae313 
>   src/Makefile.am cd503a8 
>   src/webui/common/webui_lib.py 0c56fde 
> 
> Diff: https://reviews.apache.org/r/4823/diff
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> terencekwt
> 
>