Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: test, webui
    • Labels:

      Description

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

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open In Progress In Progress
        108d 20h 16m 1 Terence Tam 05/Mar/12 00:59
        In Progress In Progress Closed Closed
        253d 22h 23m 1 Chris Lambert 13/Nov/12 23:22
        Closed Closed Open Open
        953d 10h 13m 1 Tony Stevenson 25/Jun/15 10:36
        Open Open Resolved Resolved
        7d 9h 7m 1 Vinod Kone 02/Jul/15 19:43
        Vinod Kone made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Tony Stevenson made changes -
        Workflow Mesos workflow [ 12741157 ] Copy of Mesos workflow [ 13028965 ]
        Status Closed [ 6 ] Open [ 1 ]
        Mark Thomas made changes -
        Workflow jira [ 12642458 ] Mesos workflow [ 12741157 ]
        Chris Lambert made changes -
        Status In Progress [ 3 ] Closed [ 6 ]
        Resolution Won't Fix [ 2 ]
        Hide
        Chris Lambert added a comment -

        The webui has been deprecated.

        Show
        Chris Lambert added a comment - The webui has been deprecated.
        Hide
        jiraposter@reviews.apache.org added a comment -

        On 2012-04-30 23:06:54, Charles Reiss wrote:

        > src/Makefile.am, line 718

        > <https://reviews.apache.org/r/4823/diff/2/?file=105472#file105472line718>

        >

        > 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:

        -----------------------------------------------------------

        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

        Show
        jiraposter@reviews.apache.org added a comment - On 2012-04-30 23:06:54, Charles Reiss wrote: > src/Makefile.am, line 718 > < https://reviews.apache.org/r/4823/diff/2/?file=105472#file105472line718 > > > 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: ----------------------------------------------------------- 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
        Hide
        jiraposter@reviews.apache.org added a comment -

        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

        Show
        jiraposter@reviews.apache.org added a comment - 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
        Hide
        jiraposter@reviews.apache.org added a comment -

        -----------------------------------------------------------
        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:

        -----------------------------------------------------------

        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

        Show
        jiraposter@reviews.apache.org added a comment - ----------------------------------------------------------- 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: ----------------------------------------------------------- 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
        Hide
        jiraposter@reviews.apache.org added a comment -

        -----------------------------------------------------------
        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

        Show
        jiraposter@reviews.apache.org added a comment - ----------------------------------------------------------- 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
        Hide
        jiraposter@reviews.apache.org added a comment -

        -----------------------------------------------------------
        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

        Show
        jiraposter@reviews.apache.org added a comment - ----------------------------------------------------------- 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
        Hide
        jiraposter@reviews.apache.org added a comment -

        -----------------------------------------------------------
        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

        Show
        jiraposter@reviews.apache.org added a comment - ----------------------------------------------------------- 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
        Terence Tam made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Terence Tam made changes -
        Field Original Value New Value
        Assignee Terence Tam [ terencekwt ]
        Hide
        Andy Konwinski added a comment -

        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.

        Show
        Andy Konwinski added a comment - 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.
        Hide
        Sam Whitlock added a comment - - edited

        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.

        Show
        Sam Whitlock added a comment - - edited 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.
        Charles Reiss created issue -

          People

          • Assignee:
            Terence Tam
            Reporter:
            Charles Reiss
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development