2 new revisions:

Revision: 77cf89f28961
Branch:   default
Author:   Anssi Syrjäsalo
Date:     Wed May 29 03:45:04 2013
Log:      Tests for --randomize option values...
http://code.google.com/p/robotframework/source/detail?r=77cf89f28961

Revision: d90860c92d9f
Branch:   default
Author:   Anssi Syrjäsalo
Date:     Wed May 29 03:45:20 2013
Log:      Automated merge with https://code.google.com/p/robotframework/
http://code.google.com/p/robotframework/source/detail?r=d90860c92d9f

==============================================================================
Revision: 77cf89f28961
Branch:   default
Author:   Anssi Syrjäsalo
Date:     Wed May 29 03:45:04 2013
Log:      Tests for --randomize option values

Update issue 1445

Added tests for invalid --randomize option values and option value precedence.

Moved common stderr helper keywords from invalid_usage.txt test to cli_resource.txt resource.
http://code.google.com/p/robotframework/source/detail?r=77cf89f28961

Added:
 /atest/robot/cli/runner/randomize.txt
Deleted:
 /atest/robot/cli/runner/random_order.txt
Modified:
 /atest/robot/cli/runner/cli_resource.txt
 /atest/robot/cli/runner/invalid_usage.txt
 /atest/robot/cli/runner/random_order_deprecated.txt
 /src/robot/conf/settings.py

=======================================
--- /dev/null
+++ /atest/robot/cli/runner/randomize.txt       Wed May 29 03:45:04 2013
@@ -0,0 +1,46 @@
+*** Settings ***
+Suite Setup     Check That Default Orders Are Correct
+Force Tags      pybot  jybot  regression
+Resource        cli_resource.txt
+
+*** Variables ***
+${DEFAULT SUITE ORDER} [Suite First, Sub.Suite.1, Suite3, Suite4, Suite5, Suite10, Suite 6, SUite7, suiTe 8, Suite 9 Name] +${DEFAULT TEST ORDER} [test1, test2, test3, test4, test5, test6, test7, test8, test9, test10, test11, test12]
+
+*** Test Cases ***
+Randomizing Tests
+ [Setup] Run Tests --randomize test misc/multiple_suites/01__suite_first.html
+    Should Not Be Equal As Strings  ${SUITE.tests}  ${DEFAULT TEST ORDER}
+
+Randomizing Suites
+    [Setup]  Run Tests  --randomize Suites  misc/multiple_suites
+    Should Not Be Equal As Strings  ${SUITE.suites}  ${DEFAULT SUITE ORDER}
+    ${tests} =  Get Tests
+    Should Be Equal As Strings  ${tests}  ${DEFAULT TEST ORDER}
+
+Randomizing Suites And Tests
+    [Setup]  Run Tests  --randomize all  misc/multiple_suites
+    Should Not Be Equal As Strings  ${SUITE.suites}  ${DEFAULT SUITE ORDER}
+    ${tests} =  Get Tests
+    Should Not Be Equal As Strings  ${tests}  ${DEFAULT TEST ORDER}
+
+Last Option Overrides All Previous
+ [Setup] Run Tests --randomize suites --randomize tests --randomize none misc/multiple_suites
+    Should Be Equal As Strings  ${SUITE.suites}  ${DEFAULT SUITE ORDER}
+    ${tests} =  Get Tests
+    Should Be Equal As Strings  ${tests}  ${DEFAULT TEST ORDER}
+
+Invalid Option Value
+    [Setup]  Run Tests  --randomize invalid  ${TESTFILE}
+ Stderr Should Contain Once Option '--randomize' does not support value 'invalid'.\n
+
+*** Keywords ***
+Check That Default Orders Are Correct
+    Run Tests  ${EMPTY}  misc/multiple_suites
+    Should Be Equal As Strings  ${SUITE.suites}  ${DEFAULT SUITE ORDER}
+ Should Be Equal As Strings ${SUITE.suites[0].tests} ${DEFAULT TEST ORDER}
+
+Get Tests
+ Comment This keyword is needed as there is also one directory suite, which does not contain tests. + ${tests} = Set Variable If '${SUITE.suites[0].name}' == 'Sub.Suite.1' ${SUITE.suites[0].suites[0].tests} ${SUITE.suites[0].tests}
+    [Return]  ${tests}
=======================================
--- /atest/robot/cli/runner/random_order.txt    Wed May 29 02:23:46 2013
+++ /dev/null
@@ -1,38 +0,0 @@
-*** Settings ***
-Suite Setup     Check That Default Orders Are Correct
-Force Tags      pybot  jybot  regression
-Resource        atest_resource.txt
-
-*** Variables ***
-${DEFAULT SUITE ORDER} [Suite First, Sub.Suite.1, Suite3, Suite4, Suite5, Suite10, Suite 6, SUite7, suiTe 8, Suite 9 Name] -${DEFAULT TEST ORDER} [test1, test2, test3, test4, test5, test6, test7, test8, test9, test10, test11, test12]
-
-*** Test Cases ***
-Randomizing Tests
- [Setup] Run Tests --randomize test misc/multiple_suites/01__suite_first.html
-    Should Not Be Equal As Strings  ${SUITE.tests}  ${DEFAULT TEST ORDER}
-
-Randomizing Suites
-    [Setup]  Run Tests  --randomize Suites  misc/multiple_suites
-    Should Not Be Equal As Strings  ${SUITE.suites}  ${DEFAULT SUITE ORDER}
-    ${tests} =  Get Tests
-    Should Be Equal As Strings  ${tests}  ${DEFAULT TEST ORDER}
-
-Randomizing Suites And Tests
-    [Setup]  Run Tests  --randomize all  misc/multiple_suites
-    Should Not Be Equal As Strings  ${SUITE.suites}  ${DEFAULT SUITE ORDER}
-    ${tests} =  Get Tests
-    Should Not Be Equal As Strings  ${tests}  ${DEFAULT TEST ORDER}
-
-
-*** Keywords ***
-Check That Default Orders Are Correct
-    Run Tests  ${EMPTY}  misc/multiple_suites
-    Should Be Equal As Strings  ${SUITE.suites}  ${DEFAULT SUITE ORDER}
- Should Be Equal As Strings ${SUITE.suites[0].tests} ${DEFAULT TEST ORDER}
-
-Get Tests
- Comment This keyword is needed as there is also one directory suite, which does not contain tests. - ${tests} = Set Variable If '${SUITE.suites[0].name}' == 'Sub.Suite.1' ${SUITE.suites[0].suites[0].tests} ${SUITE.suites[0].tests}
-    [Return]  ${tests}
-
=======================================
--- /atest/robot/cli/runner/cli_resource.txt    Wed Sep 12 15:17:39 2012
+++ /atest/robot/cli/runner/cli_resource.txt    Wed May 29 03:45:04 2013
@@ -34,3 +34,13 @@
     Run Tests  ${options}  ${datasource}
     Should Be Equal  ${SUITE.status}  PASS
     File Should Be Empty  ${STDERR FILE}
+
+Run Should Fail  [Arguments]  ${options}  ${exp error}
+    Set Runners
+    ${rc}  ${output} =  Run And Return RC and Output  ${ROBOT} ${options}
+    Should Be Equal As Integers  ${rc}  252
+ Should Match Regexp ${output} ^\\[ .*ERROR.* \\] ${exp error}${USAGETIP}$
+
+Stderr Should Contain Once  [Arguments]  ${msg}
+    ${stderr} =  Get Stderr
+    Should Contain X Times  ${stderr}  ${msg}  1
=======================================
--- /atest/robot/cli/runner/invalid_usage.txt   Mon May 27 02:54:24 2013
+++ /atest/robot/cli/runner/invalid_usage.txt   Wed May 29 03:45:04 2013
@@ -28,16 +28,3 @@
Stderr Should Contain Once Invalid format for option '--tagstatlink'. Expected 'tag:link:title' but got 'less_than_3x_:'.\n Stderr Should Contain Once Option '--runmode' does not support value 'INVALID'.\n
     Should Be Equal  ${SUITE.status}  PASS
-
-
-*** Keywords ***
-
-Run Should Fail  [Arguments]  ${options}  ${exp error}
-    Set Runners
-    ${rc}  ${output} =  Run And Return RC and Output  ${ROBOT} ${options}
-    Should Be Equal As Integers  ${rc}  252
- Should Match Regexp ${output} ^\\[ .*ERROR.* \\] ${exp error}${USAGETIP}$
-
-Stderr Should Contain Once  [Arguments]  ${msg}
-    ${stderr} =  Get Stderr
-    Should Contain X Times  ${stderr}  ${msg}  1
=======================================
--- /atest/robot/cli/runner/random_order_deprecated.txt Wed May 29 02:23:46 2013 +++ /atest/robot/cli/runner/random_order_deprecated.txt Wed May 29 03:45:04 2013
@@ -1,7 +1,7 @@
 *** Settings ***
 Suite Setup     Check That Default Orders Are Correct
 Force Tags      pybot  jybot  regression
-Resource        atest_resource.txt
+Resource        cli_resource.txt

 *** Variables ***
${DEFAULT SUITE ORDER} [Suite First, Sub.Suite.1, Suite3, Suite4, Suite5, Suite10, Suite 6, SUite7, suiTe 8, Suite 9 Name]
=======================================
--- /src/robot/conf/settings.py Wed May 29 02:23:46 2013
+++ /src/robot/conf/settings.py Wed May 29 03:45:04 2013
@@ -109,7 +109,7 @@
         if name == 'TagStatLink':
return [v for v in [self._process_tag_stat_link(v) for v in value] if v]
         if name == 'Randomize':
-            return self._process_randomize_target(value)
+            return self._process_randomize_value(value)
         if name in ['RemoveKeywords', 'RunMode']:
             return [v.upper() for v in value]
         return value
@@ -136,12 +136,13 @@
             raise DataError("Default visible log level '%s' is lower than "
                             "log level '%s'" % (default, log_level))

-    def _process_randomize_target(self, original_value):
+    def _process_randomize_value(self, original_value):
         formatted_value = original_value.lower()
         if formatted_value in ('test', 'suite'):
             formatted_value += 's'
         if formatted_value not in ('tests', 'suites', 'none', 'all'):
- raise DataError("Don't know how to randomize '%s'" % original_value) + raise DataError("Option '--randomize' does not support value '%s'"
+                            % original_value)
         return formatted_value

     def __getitem__(self, name):

==============================================================================
Revision: d90860c92d9f
Branch:   default
Author:   Anssi Syrjäsalo
Date:     Wed May 29 03:45:20 2013
Log:      Automated merge with https://code.google.com/p/robotframework/
http://code.google.com/p/robotframework/source/detail?r=d90860c92d9f

Deleted:
 /atest/robot/cli/runner/random_order.txt

=======================================
--- /atest/robot/cli/runner/random_order.txt    Wed May 29 02:23:46 2013
+++ /dev/null
@@ -1,38 +0,0 @@
-*** Settings ***
-Suite Setup     Check That Default Orders Are Correct
-Force Tags      pybot  jybot  regression
-Resource        atest_resource.txt
-
-*** Variables ***
-${DEFAULT SUITE ORDER} [Suite First, Sub.Suite.1, Suite3, Suite4, Suite5, Suite10, Suite 6, SUite7, suiTe 8, Suite 9 Name] -${DEFAULT TEST ORDER} [test1, test2, test3, test4, test5, test6, test7, test8, test9, test10, test11, test12]
-
-*** Test Cases ***
-Randomizing Tests
- [Setup] Run Tests --randomize test misc/multiple_suites/01__suite_first.html
-    Should Not Be Equal As Strings  ${SUITE.tests}  ${DEFAULT TEST ORDER}
-
-Randomizing Suites
-    [Setup]  Run Tests  --randomize Suites  misc/multiple_suites
-    Should Not Be Equal As Strings  ${SUITE.suites}  ${DEFAULT SUITE ORDER}
-    ${tests} =  Get Tests
-    Should Be Equal As Strings  ${tests}  ${DEFAULT TEST ORDER}
-
-Randomizing Suites And Tests
-    [Setup]  Run Tests  --randomize all  misc/multiple_suites
-    Should Not Be Equal As Strings  ${SUITE.suites}  ${DEFAULT SUITE ORDER}
-    ${tests} =  Get Tests
-    Should Not Be Equal As Strings  ${tests}  ${DEFAULT TEST ORDER}
-
-
-*** Keywords ***
-Check That Default Orders Are Correct
-    Run Tests  ${EMPTY}  misc/multiple_suites
-    Should Be Equal As Strings  ${SUITE.suites}  ${DEFAULT SUITE ORDER}
- Should Be Equal As Strings ${SUITE.suites[0].tests} ${DEFAULT TEST ORDER}
-
-Get Tests
- Comment This keyword is needed as there is also one directory suite, which does not contain tests. - ${tests} = Set Variable If '${SUITE.suites[0].name}' == 'Sub.Suite.1' ${SUITE.suites[0].suites[0].tests} ${SUITE.suites[0].tests}
-    [Return]  ${tests}
-

--

--- You received this message because you are subscribed to the Google Groups "robotframework-commit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to