Closed JamesJeffryes closed 6 years ago
so the behavior now would be that kb-sdk init creates a run_module function in the impl file that prints "hello world"
On Wed, Oct 31, 2018 at 2:20 PM James Jeffryes notifications@github.com wrote:
OK, this was more painful than expected but you should be able to initialize Python, Perl and Java modules and run kb-sdk test to produce a hello world report.
You can view, comment on, or merge this pull request online at:
https://github.com/kbase/kb_sdk/pull/329 Commit Summary
- convert files to be compatible with python3
- fix ERR_CONTENT_LENGTH_MISMATCH
- more tweaks
- more python3 cleanup
- Merge remote-tracking branch 'origin/develop' into python3
- Add dependency tracking with pipenv
- Add note in the README.md about using pipenv
- Get flake8 linter passing on python code, including test_scripts/*/.py
- Remove test print line
- Alter makefile to prevent python/js/perl/R client generation; move java flags into the java language condition.
- Merge pull request #1 from jayrbolton/python3
- Add temp_test* into the flake8 ignores
- Add a test-python target/command to the Makefile for convenience
- Add some more pipenv-related documentation to the readme
- Prevent a flake8 error in authclient.py
- Remove --java flag as it is unnecessary when combined with --javasrv
- Merge pull request #2 from jayrbolton/python3
- Sync up the changes from njs_wrapper for CallbackServerConfigBuilder and SubsequentCallRunner
- Merge branch 'develop' into python3
- Merge branch 'develop' into python3
- Merge branch 'python3' of https://github.com/JamesJeffryes/kb_sdk into python3
- Add python 2 and 3 setup and pip installation commands in Vagrantfile
- Replace Pipfile/pipenv with a requirements.txt -- pipenv is not necessary with vagrant
- Add vagrant-based make targets for testing both python2 and python3
- Ignore env-*/
- Merge branch 'develop' into python3
- Merge branch 'develop' into refdata-fixes
- Sync up src with latest from njs
- Update docker base images
- revert unnessisary auth addition
- update stringIO call
- Merge pull request #315 from JamesJeffryes/python3
- remove -user $(id -u) setting which causes issues running local tests
- Clean up python test template, esp. make tests use installed WS
- Merge pull request #321 from JamesJeffryes/SCT-1193
- Add a line to test script run in docker container to remove any lingering files in the scratch space
- remove what local files we can before building the image
- Note that temp files are being cleaned
- Merge pull request #320 from JamesJeffryes/PUBLIC-436
- make sure temp folder itself is not removed in cleaning
- bump version and add release notes
- Merge pull request #322 from JamesJeffryes/new_version
- avoid use of "message" attribute in exceptions
- use "repr" instead of "str" to ensure that the error type is retained
- Merge pull request #323 from JamesJeffryes/tweak_server_exception
- Don't auto-generate clients for each language in the wrong place
- Installed clients in perl, r and python go into a installed_clients folder
- Make init have default impl that accepts a param dict and returns report refs. Renames "examplemodule" to "run
" - Merge pull request #1 from JamesJeffryes/PR-316
- Same for Java. Kinda confused why it wasn't need to update the imports but I guess that the clients are compiling to the same location?
- Catch another exception type associated with BADSTATUSCODE
- Merge pull request #316 from jayrbolton/dont-generate-unnecessary-client-code
- Merge pull request #317 from jayrbolton/refdata-fixes
- Merge pull request #328 from JamesJeffryes/SCT-1366
- fix text, make into mapping, pass woerkspace_id
- Merge pull request #326 from JamesJeffryes/SCT-1585
- Merge pull request #327 from JamesJeffryes/SCT-1586
- Add helloworld method for each language to each app
File Changes
- M .gitignore https://github.com/kbase/kb_sdk/pull/329/files#diff-0 (5)
- M Makefile https://github.com/kbase/kb_sdk/pull/329/files#diff-1 (24)
- M README.md https://github.com/kbase/kb_sdk/pull/329/files#diff-2 (15)
- M RELEASE_NOTES.txt https://github.com/kbase/kb_sdk/pull/329/files#diff-3 (19)
- M Vagrantfile https://github.com/kbase/kb_sdk/pull/329/files#diff-4 (8)
- M doc/test_dependencies.md https://github.com/kbase/kb_sdk/pull/329/files#diff-5 (26)
- M lib/biokbase/common/filetools.py https://github.com/kbase/kb_sdk/pull/329/files#diff-6 (4)
- M lib/biokbase/common/itertools.py https://github.com/kbase/kb_sdk/pull/329/files#diff-7 (2)
- M lib/biokbase/log.py https://github.com/kbase/kb_sdk/pull/329/files#diff-8 (13)
- A requirements.txt https://github.com/kbase/kb_sdk/pull/329/files#diff-9 (3)
- M src/java/us/kbase/common/executionengine/CallbackServerConfigBuilder.java https://github.com/kbase/kb_sdk/pull/329/files#diff-10 (11)
- M src/java/us/kbase/common/executionengine/SubsequentCallRunner.java https://github.com/kbase/kb_sdk/pull/329/files#diff-11 (10)
- M src/java/us/kbase/mobu/ModuleBuilder.java https://github.com/kbase/kb_sdk/pull/329/files#diff-12 (4)
- M src/java/us/kbase/mobu/compiler/TemplateBasedGenerator.java https://github.com/kbase/kb_sdk/pull/329/files#diff-13 (8)
- M src/java/us/kbase/mobu/initializer/ModuleInitializer.java https://github.com/kbase/kb_sdk/pull/329/files#diff-14 (120)
- M src/java/us/kbase/mobu/installer/ClientInstaller.java https://github.com/kbase/kb_sdk/pull/329/files#diff-15 (10)
- M src/java/us/kbase/mobu/installer/test/ClientInstallerTest.java https://github.com/kbase/kb_sdk/pull/329/files#diff-16 (23)
- M src/java/us/kbase/mobu/runner/ModuleRunner.java https://github.com/kbase/kb_sdk/pull/329/files#diff-17 (5)
- M src/java/us/kbase/mobu/tester/ConfigLoader.java https://github.com/kbase/kb_sdk/pull/329/files#diff-18 (2)
- M src/java/us/kbase/mobu/tester/ModuleTester.java https://github.com/kbase/kb_sdk/pull/329/files#diff-19 (4)
- M src/java/us/kbase/mobu/tester/SDKSubsequentCallRunner.java https://github.com/kbase/kb_sdk/pull/329/files#diff-20 (10)
- M src/java/us/kbase/mobu/tester/test/CallbackServerTest.java https://github.com/kbase/kb_sdk/pull/329/files#diff-21 (2)
- M src/java/us/kbase/templates/authclient.py https://github.com/kbase/kb_sdk/pull/329/files#diff-22 (13)
- M src/java/us/kbase/templates/baseclient.py https://github.com/kbase/kb_sdk/pull/329/files#diff-23 (5)
- M src/java/us/kbase/templates/module_dockerfile.vm.properties https://github.com/kbase/kb_sdk/pull/329/files#diff-24 (6)
- M src/java/us/kbase/templates/module_java_impl.vm.properties https://github.com/kbase/kb_sdk/pull/329/files#diff-25 (47)
- M src/java/us/kbase/templates/module_makefile.vm.properties https://github.com/kbase/kb_sdk/pull/329/files#diff-26 (12)
- M src/java/us/kbase/templates/module_method_spec_json.vm.properties https://github.com/kbase/kb_sdk/pull/329/files#diff-27 (36)
- M src/java/us/kbase/templates/module_method_spec_yaml.vm.properties https://github.com/kbase/kb_sdk/pull/329/files#diff-28 (7)
- M src/java/us/kbase/templates/module_perl_impl.vm.properties https://github.com/kbase/kb_sdk/pull/329/files#diff-29 (44)
- M src/java/us/kbase/templates/module_prepare_deploy_cfg.vm.properties https://github.com/kbase/kb_sdk/pull/329/files#diff-30 (10)
- M src/java/us/kbase/templates/module_python_impl.vm.properties https://github.com/kbase/kb_sdk/pull/329/files#diff-31 (37)
- M src/java/us/kbase/templates/module_r_impl.vm.properties https://github.com/kbase/kb_sdk/pull/329/files#diff-32 (2)
- M src/java/us/kbase/templates/module_run_bash.vm.properties https://github.com/kbase/kb_sdk/pull/329/files#diff-33 (5)
- M src/java/us/kbase/templates/module_run_tests.vm.properties https://github.com/kbase/kb_sdk/pull/329/files#diff-34 (9)
- M src/java/us/kbase/templates/module_test_java_client.vm.properties https://github.com/kbase/kb_sdk/pull/329/files#diff-35 (9)
- M src/java/us/kbase/templates/module_test_perl_client.vm.properties https://github.com/kbase/kb_sdk/pull/329/files#diff-36 (10)
- M src/java/us/kbase/templates/module_test_python_client.vm.properties https://github.com/kbase/kb_sdk/pull/329/files#diff-37 (29)
- M src/java/us/kbase/templates/module_typespec.vm.properties https://github.com/kbase/kb_sdk/pull/329/files#diff-38 (9)
- M src/java/us/kbase/templates/python_client.vm.properties https://github.com/kbase/kb_sdk/pull/329/files#diff-39 (2)
- M src/java/us/kbase/templates/python_impl.vm.properties https://github.com/kbase/kb_sdk/pull/329/files#diff-40 (2)
- M src/java/us/kbase/templates/python_server.vm.properties https://github.com/kbase/kb_sdk/pull/329/files#diff-41 (61)
- M test_scripts/py_module_tests/test_auth_client.py https://github.com/kbase/kb_sdk/pull/329/files#diff-42 (12)
- M test_scripts/py_module_tests/test_token_cache.py https://github.com/kbase/kb_sdk/pull/329/files#diff-43 (8)
- M test_scripts/python/run_client.py https://github.com/kbase/kb_sdk/pull/329/files#diff-44 (34)
- M test_scripts/python/test_client.py https://github.com/kbase/kb_sdk/pull/329/files#diff-45 (45)
- M test_scripts/test.cfg https://github.com/kbase/kb_sdk/pull/329/files#diff-46 (4)
- M tox.ini https://github.com/kbase/kb_sdk/pull/329/files#diff-47 (1)
Patch Links:
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kbase/kb_sdk/pull/329, or mute the thread https://github.com/notifications/unsubscribe-auth/AH0y9OHq14E5JVskWElZuKHhJ7UcaCbtks5uqhQcgaJpZM4YFQDC .
Actually the created report says "Hello World" (in the test) or what ever you specify in "parameter_1"
Testing and looking through things
There was an issue with the Java test that I commented about above. The perl version seems to work fine (although I can't make heads or tails of that test file, wowzers). The python version throws an error for me:
Traceback (most recent call last):
File "/miniconda/lib/python3.6/site-packages/nose/failure.py", line 39, in runTest
raise self.exc_val.with_traceback(self.tb)
File "/miniconda/lib/python3.6/site-packages/nose/loader.py", line 523, in makeTest
return self._makeTest(obj, parent)
File "/miniconda/lib/python3.6/site-packages/nose/loader.py", line 582, in _makeTest
return MethodTestCase(obj)
File "/miniconda/lib/python3.6/site-packages/nose/case.py", line 346, in __init__
self.inst = self.cls()
TypeError: __init__() missing 1 required positional argument: 'config'
@JamesJeffryes any ideas? It seems to run the actual test method before the error is raised. I can't tell how or where it gets raised.
So the Java issue was some bad copy pasta that I missed because I kept using "javafoo" as my module name. I actually can't replicate the Python error you are seeing though. Do you see it when you init with the -e
flag too?
It looks like default tests do work on the filter contigs example, but I still get the above error on the hello world example
I finally found the cause of the python error. It's pretty obscure and probably not related to this update.
I was calling my modules "test_python_hello_worldetc". That "test" prefix on the module name was causing nose2 to do something weird with it. When I rename my module to python_hello_world, it is fixed. Something to note on the troubleshooting page I guess.
OK, this was more painful than expected but you should be able to initialize Python, Perl and Java modules and run
kb-sdk test
to produce a hello world report.