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 (Created) (JIRA)" <ji...@apache.org> on 2011/11/17 05:44:52 UTC

[jira] [Created] (MESOS-93) Add unit tests for webui

Add unit tests for webui
------------------------

                 Key: MESOS-93
                 URL: https://issues.apache.org/jira/browse/MESOS-93
             Project: Mesos
          Issue Type: Improvement
          Components: test, webui
            Reporter: Charles Reiss


The WebUI should have unit tests. Ideally, these tests should mock out the Master and Slave entirely and thus be pure python tests.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MESOS-93) Add unit tests for webui

Posted by "jiraposter@reviews.apache.org (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MESOS-93?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13258580#comment-13258580 ] 

jiraposter@reviews.apache.org commented on MESOS-93:
----------------------------------------------------


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


                
> Add unit tests for webui
> ------------------------
>
>                 Key: MESOS-93
>                 URL: https://issues.apache.org/jira/browse/MESOS-93
>             Project: Mesos
>          Issue Type: Improvement
>          Components: test, webui
>            Reporter: Charles Reiss
>            Assignee: Terence Tam
>              Labels: test, webui
>
> The WebUI should have unit tests. Ideally, these tests should mock out the Master and Slave entirely and thus be pure python tests.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MESOS-93) Add unit tests for webui

Posted by "jiraposter@reviews.apache.org (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MESOS-93?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13258085#comment-13258085 ] 

jiraposter@reviews.apache.org commented on MESOS-93:
----------------------------------------------------


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

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


                
> Add unit tests for webui
> ------------------------
>
>                 Key: MESOS-93
>                 URL: https://issues.apache.org/jira/browse/MESOS-93
>             Project: Mesos
>          Issue Type: Improvement
>          Components: test, webui
>            Reporter: Charles Reiss
>            Assignee: Terence Tam
>              Labels: test, webui
>
> The WebUI should have unit tests. Ideally, these tests should mock out the Master and Slave entirely and thus be pure python tests.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MESOS-93) Add unit tests for webui

Posted by "Andy Konwinski (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MESOS-93?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13156567#comment-13156567 ] 

Andy Konwinski commented on MESOS-93:
-------------------------------------

I haven't heard of either of those (but haven't written serious tests in Python before, so that isn't saying much). Have you checked out http://wiki.python.org/moin/PythonTestingToolsTaxonomy ? Maybe we should use the plain ol' http://pyunit.sourceforge.net/pyunit.html for simple unit tests since it's included in the python standard library. I sure wish we had some unit tests in place for the webui now that I've been helping with MESOS-33 and MESOS-8 and manually catching some (but probably not all) regressions.
                
> Add unit tests for webui
> ------------------------
>
>                 Key: MESOS-93
>                 URL: https://issues.apache.org/jira/browse/MESOS-93
>             Project: Mesos
>          Issue Type: Improvement
>          Components: test, webui
>            Reporter: Charles Reiss
>              Labels: test, webui
>
> The WebUI should have unit tests. Ideally, these tests should mock out the Master and Slave entirely and thus be pure python tests.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Assigned] (MESOS-93) Add unit tests for webui

Posted by "Terence Tam (Assigned) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MESOS-93?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Terence Tam reassigned MESOS-93:
--------------------------------

    Assignee: Terence Tam
    
> Add unit tests for webui
> ------------------------
>
>                 Key: MESOS-93
>                 URL: https://issues.apache.org/jira/browse/MESOS-93
>             Project: Mesos
>          Issue Type: Improvement
>          Components: test, webui
>            Reporter: Charles Reiss
>            Assignee: Terence Tam
>              Labels: test, webui
>
> The WebUI should have unit tests. Ideally, these tests should mock out the Master and Slave entirely and thus be pure python tests.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MESOS-93) Add unit tests for webui

Posted by "jiraposter@reviews.apache.org (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MESOS-93?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13264655#comment-13264655 ] 

jiraposter@reviews.apache.org commented on MESOS-93:
----------------------------------------------------


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

(Updated 2012-04-30 00:52:34.340837)


Review request for mesos and Charles Reiss.


Changes
-------

*added test and files to Makefile.am
*test json are in string literals now. But should i build the json as dictionaries first, and then convert in to string literals using the json encoding function. If so, I can place these testcases into a .json file instead.
*displaying the exception when testcases fails


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 (updated)
-----

  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


                
> Add unit tests for webui
> ------------------------
>
>                 Key: MESOS-93
>                 URL: https://issues.apache.org/jira/browse/MESOS-93
>             Project: Mesos
>          Issue Type: Improvement
>          Components: test, webui
>            Reporter: Charles Reiss
>            Assignee: Terence Tam
>              Labels: test, webui
>
> The WebUI should have unit tests. Ideally, these tests should mock out the Master and Slave entirely and thus be pure python tests.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MESOS-93) Add unit tests for webui

Posted by "jiraposter@reviews.apache.org (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MESOS-93?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13266782#comment-13266782 ] 

jiraposter@reviews.apache.org commented on MESOS-93:
----------------------------------------------------



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

Done renaming.


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

Done adding what Exception is thrown.


bq.  On 2012-04-20 20:48:34, Charles Reiss wrote:
bq.  > src/webui/common/webui_lib.py, line 87
bq.  > <https://reviews.apache.org/r/4823/diff/1/?file=103459#file103459line87>
bq.  >
bq.  >     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.


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


                
> Add unit tests for webui
> ------------------------
>
>                 Key: MESOS-93
>                 URL: https://issues.apache.org/jira/browse/MESOS-93
>             Project: Mesos
>          Issue Type: Improvement
>          Components: test, webui
>            Reporter: Charles Reiss
>            Assignee: Terence Tam
>              Labels: test, webui
>
> The WebUI should have unit tests. Ideally, these tests should mock out the Master and Slave entirely and thus be pure python tests.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MESOS-93) Add unit tests for webui

Posted by "jiraposter@reviews.apache.org (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MESOS-93?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13266783#comment-13266783 ] 

jiraposter@reviews.apache.org commented on MESOS-93:
----------------------------------------------------



bq.  On 2012-04-30 23:06:54, Charles Reiss wrote:
bq.  > src/Makefile.am, line 718
bq.  > <https://reviews.apache.org/r/4823/diff/2/?file=105472#file105472line718>
bq.  >
bq.  >     I assume you meant run_testcases.sh?

I actually meant run_testcases.py, as i added the #!usr/bin/env python in the beginning of the .py file. Will that also need to use the TESTS_ENVIRONMENT passing $(PYTHON) from src/Makefile.am?


- terencekwt


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


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


                
> Add unit tests for webui
> ------------------------
>
>                 Key: MESOS-93
>                 URL: https://issues.apache.org/jira/browse/MESOS-93
>             Project: Mesos
>          Issue Type: Improvement
>          Components: test, webui
>            Reporter: Charles Reiss
>            Assignee: Terence Tam
>              Labels: test, webui
>
> The WebUI should have unit tests. Ideally, these tests should mock out the Master and Slave entirely and thus be pure python tests.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MESOS-93) Add unit tests for webui

Posted by "Sam Whitlock (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MESOS-93?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13152223#comment-13152223 ] 

Sam Whitlock commented on MESOS-93:
-----------------------------------

What mocking framework should we use? Google has pymox (http://code.google.com/p/pymox/), but I prefer this one (http://www.voidspace.org.uk/python/mock/) because the semantics are a little easier to work with, imo.
                
> Add unit tests for webui
> ------------------------
>
>                 Key: MESOS-93
>                 URL: https://issues.apache.org/jira/browse/MESOS-93
>             Project: Mesos
>          Issue Type: Improvement
>          Components: test, webui
>            Reporter: Charles Reiss
>              Labels: test, webui
>
> The WebUI should have unit tests. Ideally, these tests should mock out the Master and Slave entirely and thus be pure python tests.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MESOS-93) Add unit tests for webui

Posted by "jiraposter@reviews.apache.org (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MESOS-93?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13265488#comment-13265488 ] 

jiraposter@reviews.apache.org commented on MESOS-93:
----------------------------------------------------


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



src/Makefile.am
<https://reviews.apache.org/r/4823/#comment16304>

    Remove trailing whitespace (and elsewhere in this file)



src/Makefile.am
<https://reviews.apache.org/r/4823/#comment16307>

    Even if this order works, move WEBUI_TESTS = before the TESTS +=



src/Makefile.am
<https://reviews.apache.org/r/4823/#comment16308>

    I assume you meant run_testcases.sh?



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

    Shouldn't you make a test suite? Also, can we run the tests using unittest's command-line interface ( http://docs.python.org/library/unittest.html#command-line-interface )



src/webui/tests/run_testcases.sh
<https://reviews.apache.org/r/4823/#comment16309>

    Use TESTS_ENVIRONMENT to pass $(PYTHON) from src/Makefile.am and use that here. (We should support configuring Mesos to use a version of Python other than the one that is first on the PATH.)



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

    Pass this (and other long JSON strings in this file) through a JSON pretty printer (so it uses multiple lines in a natural way) and use """-quotes. Then, the test case should be human readable/editable. (I also wouldn't object to forming the JSON string programmatically from the parsed version, so long as the test gets a string.)


- Charles


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


                
> Add unit tests for webui
> ------------------------
>
>                 Key: MESOS-93
>                 URL: https://issues.apache.org/jira/browse/MESOS-93
>             Project: Mesos
>          Issue Type: Improvement
>          Components: test, webui
>            Reporter: Charles Reiss
>            Assignee: Terence Tam
>              Labels: test, webui
>
> The WebUI should have unit tests. Ideally, these tests should mock out the Master and Slave entirely and thus be pure python tests.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (MESOS-93) Add unit tests for webui

Posted by "Sam Whitlock (Issue Comment Edited) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MESOS-93?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13152223#comment-13152223 ] 

Sam Whitlock edited comment on MESOS-93 at 11/17/11 6:49 PM:
-------------------------------------------------------------

What mocking framework should be used for the webui? Google has pymox (http://code.google.com/p/pymox/), but I prefer this one (http://www.voidspace.org.uk/python/mock/) because the semantics are a little easier to work with, imo.
                
      was (Author: _sam_):
    What mocking framework should we use? Google has pymox (http://code.google.com/p/pymox/), but I prefer this one (http://www.voidspace.org.uk/python/mock/) because the semantics are a little easier to work with, imo.
                  
> Add unit tests for webui
> ------------------------
>
>                 Key: MESOS-93
>                 URL: https://issues.apache.org/jira/browse/MESOS-93
>             Project: Mesos
>          Issue Type: Improvement
>          Components: test, webui
>            Reporter: Charles Reiss
>              Labels: test, webui
>
> The WebUI should have unit tests. Ideally, these tests should mock out the Master and Slave entirely and thus be pure python tests.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Closed] (MESOS-93) Add unit tests for webui

Posted by "Chris Lambert (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MESOS-93?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chris Lambert closed MESOS-93.
------------------------------

    Resolution: Won't Fix

The webui has been deprecated.
                
> Add unit tests for webui
> ------------------------
>
>                 Key: MESOS-93
>                 URL: https://issues.apache.org/jira/browse/MESOS-93
>             Project: Mesos
>          Issue Type: Improvement
>          Components: test, webui
>            Reporter: Charles Reiss
>            Assignee: Terence Tam
>              Labels: test, webui
>
> The WebUI should have unit tests. Ideally, these tests should mock out the Master and Slave entirely and thus be pure python tests.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira