You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally submitted to Google Code by zimmermann.code on 6 Aug 2013
Robot Framework 2.8.x introduces **kwargs support for Test Library Keywords (to pass a dictionary to the Keyword which contains all name=value arguments from the Keyword call that can't be mapped to the Keyword's positional parameters, just like it works with normal Python functions).
This support is still missing for Dynamic Test Libraries.
It's already working. It just needs some additional minor changes and some more tests, as discussed in the #robotframework IRC channel at freenode.net.
Here is the log (14:01 - 15:32):
Originally submitted to Google Code by zimmermann.code on 12 Sep 2013
Still in progress :(
There just were so much other things to do the last weeks... other Robot things :)
I will finish it in the beginning of next week.
Originally submitted to Google Code by zimmermann.code on 17 Sep 2013
Almost done...
I just looked for tests using DynamicLibrary implementations and started to add tests for analogous/derived DynamicLibraryWithKwargsSupport implementations, which also verify the same behavior as DynamicLibrary when using Keywords without **kwargs.
When trying to further adapt atest/testdata/test_libraries/dynamic_library_python.txt, I recognized that **kwargs handling doesn't work in a generic way if no get_keyword_arguments is defined, so i also added support for this:
Originally submitted to Google Code by zimmermann.code on 28 Sep 2013
Took me a while to get used to Jython and making it run the atests.
I never used Jython and barely used Java at all before... :)
My Jython is a 2.5.2, which led to the exploration of some incompatibilities of my dynamic **kwargs support code with Python/Jython 2.5 (inspect.getargspec returns a plain tuple in 2.5), so I changed that parts to use PythonArgumentParser from robot.running.arguments:
Originally submitted to Google Code by zimmermann.code on 7 Oct 2013
Finished! :D
The use of PythonArgumentParser mentioned in the last comment introduced an incompatibility with Dynamic Java Test Libraries, so I created a generic DynamicMethodArgumentParser for getting the argspec of Dynamic API methods, either Python or Java based:
I built the Java tests on the RunKeywordLibraryJava and ArgDocDynamicJavaLibrary classes by deriving classes with a "WithKwargsSupport" suffix. For the third runKeyword parameter I used the org.python.core.PyDictionary class. This needed a little fix in JavaArgumentParser:
You can simply add my changes (without the other branches) by pulling with -B master from my repo and reverting the README.txt on merging.
The changes also contain the fixes from issue 1531 . Should I revert them?
Great! I'll take a look at this when I have time. Probably not today but hopefully this week. This stuff will definitely be included into 2.8.2 anyway.
In my opinion changes related to issue 1531 can be reverted. I rather document that running atests requires Python 2.6 or newer.
Finally starting to merge these changes. I was trying to pull changes directly from your fork, but I got also some unrelated stuff I would like to ignore. Changes to README are easy to handle somehow, but I don't want to pull your python3 branch.
Do you have any idea what would be the easiest way to get only changes related to **kwargs with dynamic libs?
The code was merged in revision 3134960a8729. That commit contains everything pulled with hg pull <a href="https://bitbucket.org/userzimmermann/robotframework" rel="nofollow">https://bitbucket.org/userzimmermann/robotframework</a> -B master except for README.txt changes.
We started cleaning up the code (including old code) in revision a74fa38a0dd1 and also added TODOs for further code and test cleanup. We'll continue with that work tomorrow.
Documentation changes haven't been reviewed at all.
Thanks a lot for your work Stefan! We were impressed with the changes you had done to code and tests. Most of the things that we want to cleanup are actually places where the old code/test was bad.
Refactored detecting does run_keyword support **kwargs. Now RunKeyword knows it and we also got rid off DynamicMethodArgumentParser.
We did some changes to internal APIs to make the code cleaner, but those changes should not matter to anyone using Robot.
We have now gone through all the TODOs we added to tests and code while merging in the original code. Next up is reviewing the docs. After that this issue ought to be done. Comments from Stefan regarding to our changes are obviously welcome.
Activity
spooning commentedon Jun 30, 2014
This looks very good already! Tasks to do:
spooning commentedon Jun 30, 2014
The diff link in the issue description always shows the complete changes (including the above).
spooning commentedon Jun 30, 2014
@zimmermann.code: What's the situation with tasks 2) and 3)?
spooning commentedon Jun 30, 2014
Still in progress :(
There just were so much other things to do the last weeks... other Robot things :)
I will finish it in the beginning of next week.
spooning commentedon Jun 30, 2014
I just looked for tests using DynamicLibrary implementations and started to add tests for analogous/derived DynamicLibraryWithKwargsSupport implementations, which also verify the same behavior as DynamicLibrary when using Keywords without **kwargs.
This diff shows what I've done so far:
https://bitbucket.org/userzimmermann/robotframework/compare/e54338e..f20bda9#diff
spooning commentedon Jun 30, 2014
The tests with DynamicLibraryWithKwargsSupport are done, hopefully :)
https://bitbucket.org/userzimmermann/robotframework/compare/853a6e7..f20bda9#diff
When trying to further adapt atest/testdata/test_libraries/dynamic_library_python.txt, I recognized that **kwargs handling doesn't work in a generic way if no get_keyword_arguments is defined, so i also added support for this:
https://bitbucket.org/userzimmermann/robotframework/commits/d9ba198731cc1b4703d9255fcc26f2217ad1ff1c
spooning commentedon Jun 30, 2014
test_libraries/dynamic_kwargs_support_python.txt:
https://bitbucket.org/userzimmermann/robotframework/commits/864bdcac167853c7dcb8c7555fab57f80196afba
The complete current fork diff:
https://bitbucket.org/userzimmermann/robotframework/compare/default..4803bde#diff
Next: Tests for Dynamic Java Test Libraries...
spooning commentedon Jun 30, 2014
Just a little update related to issue 1525 :
https://bitbucket.org/userzimmermann/robotframework/commits/7157bf2c6788567c81c17c677573532764ba244b
spooning commentedon Jun 30, 2014
Took me a while to get used to Jython and making it run the atests.
I never used Jython and barely used Java at all before... :)
My Jython is a 2.5.2, which led to the exploration of some incompatibilities of my dynamic **kwargs support code with Python/Jython 2.5 (inspect.getargspec returns a plain tuple in 2.5), so I changed that parts to use PythonArgumentParser from robot.running.arguments:
https://bitbucket.org/userzimmermann/robotframework/commits/821d5b0574a4b28d180e9c4f735a8d9ae0af22c5
I also found some 2.5 incompatibilities in some general atest Python modules. I opened a separate issue 1531 for that.
Now I will finally create the tests for Dynamic Java Test Libraries...
spooning commentedon Jun 30, 2014
Finished! :D
The use of PythonArgumentParser mentioned in the last comment introduced an incompatibility with Dynamic Java Test Libraries, so I created a generic DynamicMethodArgumentParser for getting the argspec of Dynamic API methods, either Python or Java based:
https://bitbucket.org/userzimmermann/robotframework/commits/431162f86164198ad16846336b83310813a4cca5
I built the Java tests on the RunKeywordLibraryJava and ArgDocDynamicJavaLibrary classes by deriving classes with a "WithKwargsSupport" suffix. For the third runKeyword parameter I used the org.python.core.PyDictionary class. This needed a little fix in JavaArgumentParser:
https://bitbucket.org/userzimmermann/robotframework/commits/7d96a121e6e7cfcedd7640e6168a85ef5521abf2
All dynamic **kwargs tests are working fine with Python 2.5-2.7 and Jython 2.5, and, if you are interested, even with Python 3 in my python3 branch:
https://bitbucket.org/userzimmermann/robotframework/commits/branch/python3
I made the following additions to the documentation:
https://bitbucket.org/userzimmermann/robotframework/commits/6edae790b59aecd5021f323c917ed58a3659e05c
The final complete fork diff can be seen at this URL:
https://bitbucket.org/userzimmermann/robotframework/compare/default..2044532#diff
You can simply add my changes (without the other branches) by pulling with -B master from my repo and reverting the README.txt on merging.
The changes also contain the fixes from issue 1531 . Should I revert them?
spooning commentedon Jun 30, 2014
Great! I'll take a look at this when I have time. Probably not today but hopefully this week. This stuff will definitely be included into 2.8.2 anyway.
In my opinion changes related to issue 1531 can be reverted. I rather document that running atests requires Python 2.6 or newer.
spooning commentedon Jun 30, 2014
Issue 1531 stuff reverted.
New complete fork diff:
https://bitbucket.org/userzimmermann/robotframework/compare/master..839cfa9#diff
spooning commentedon Jun 30, 2014
ooops: utest! I always forget something ;)
I made the necessary changes and added/extended tests for dynamic **kwargs support in:
utest/running/test_handlers.py
utest/running/test_testlibrary.py
I also made some further additions to the atests.
New complete fork diff (merged with latest robot commit):
https://bitbucket.org/userzimmermann/robotframework/compare/master..b912f15#diff
spooning commentedon Jun 30, 2014
Finally starting to merge these changes. I was trying to pull changes directly from your fork, but I got also some unrelated stuff I would like to ignore. Changes to README are easy to handle somehow, but I don't want to pull your python3 branch.
Do you have any idea what would be the easiest way to get only changes related to **kwargs with dynamic libs?
5 remaining items
spooning commentedon Jun 30, 2014
This issue was updated by revision a74fa38a0dd1.
Cleaning up implementation and tests. Some more further cleanup still needed,
but there are now TODOs about them.
Docs not proofread at all yet.
spooning commentedon Jun 30, 2014
The code was merged in revision 3134960a8729. That commit contains everything pulled with
hg pull <a href="https://bitbucket.org/userzimmermann/robotframework" rel="nofollow">https://bitbucket.org/userzimmermann/robotframework</a> -B masterexcept for README.txt changes.We started cleaning up the code (including old code) in revision a74fa38a0dd1 and also added TODOs for further code and test cleanup. We'll continue with that work tomorrow.
Documentation changes haven't been reviewed at all.
Thanks a lot for your work Stefan! We were impressed with the changes you had done to code and tests. Most of the things that we want to cleanup are actually places where the old code/test was bad.
spooning commentedon Jun 30, 2014
This issue was updated by revision 387e1cf4dc70.
Combined invalid argspec tests.
spooning commentedon Jun 30, 2014
This issue was updated by revision 3d9d713eb6b1.
Further test cleanup
spooning commentedon Jun 30, 2014
This issue was updated by revision 54ed6c9c33cf.
Return '_varargs, *_kwargs' and not '_unknown, *_kwargs' if there is no arg spec.
spooning commentedon Jun 30, 2014
This issue was updated by revision e3ae9ca64a98.
Refactored detecting does run_keyword support **kwargs. Now RunKeyword knows it and we also got rid off DynamicMethodArgumentParser.
We did some changes to internal APIs to make the code cleaner, but those changes should not matter to anyone using Robot.
We have now gone through all the TODOs we added to tests and code while merging in the original code. Next up is reviewing the docs. After that this issue ought to be done. Comments from Stefan regarding to our changes are obviously welcome.
spooning commentedon Jun 30, 2014
This issue was updated by revision 068200916073.
Thought we run tests before last commit but apparently not. Fixed broken Java dynamic library support now.
spooning commentedon Jun 30, 2014
This issue was updated by revision 07aa2951ea02.
Fixed unit test that didn't work with IronPython due to lambda.name differences.
spooning commentedon Jun 30, 2014
This issue was updated by revision 9d6aa4cb9bb6.
Started reviewing/enhancing documentation. Work in progress.
spooning commentedon Jun 30, 2014
This issue was updated by revision afb1ca854f97.
Enhanced docs and they are now ready for proofreading/review.
spooning commentedon Jun 30, 2014
Direct link to latest version of the docs:
http://robotframework.googlecode.com/hg/doc/userguide/RobotFrameworkUserGuide.html#dynamic-library-api