Kappa-Dev/KappaTools

error running kappy unit tests

Closed this issue · 6 comments

Hi,

I just upgraded kappy, and when running one of kappy's unit tests, kappa_std.py, I get a series of permission denied errors that look like this:

======================================================================
ERROR: test_static_analyses (test_std.StdClientTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "KaSim/python/tests/util.py", line 159, in test_static_analyses
    runtime = self.getRuntime()
  File "KaSim/python/tests/test_std.py", line 16, in getRuntime
    return kappy.KappaStd(BIN_DIR)
  File "/Users/yarden/miniconda2/envs/py3/lib/python3.7/site-packages/kappy/kappa_std.py", line 61, in __init__
    stderr=subprocess.STDOUT)
  File "/Users/yarden/miniconda2/envs/py3/lib/python3.7/subprocess.py", line 775, in __init__
    restore_signals, start_new_session)
  File "/Users/yarden/miniconda2/envs/py3/lib/python3.7/subprocess.py", line 1522, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
PermissionError: [Errno 13] Permission denied: '/Users/yarden/miniconda2/envs/py3/lib/python3.7/site-packages/kappy/bin/KappaSwitchman'
-------------------- >> begin captured stdout << ---------------------
Getting runtime...

--------------------- >> end captured stdout << ----------------------

----------------------------------------------------------------------
Ran 6 tests in 0.029s

FAILED (errors=5)

It sounds like something went wrong with the pip installation of kappy. All I did was pip install . in the KaSim/ directory, and it generated no error. I didn't install the package as root or anything like that, so I don't understand where the permission denied error is coming from.

This doesn't necessarily mean kappy is broken - normally I just feed it a URL/path to where KaSim binaries are and don't rely on the function to find agent binaries. Do these tests work for other people?

Thanks.

veghp commented

Hi @pirbo , thanks for writing kappy, it's very useful. We use it for topkappy and kappagate.

Has this issue been solved? There is a similar error (PermissionError) for KappaSwitchman. Please see CI outputs for detail:
https://travis-ci.org/github/Edinburgh-Genome-Foundry/kappagate
https://travis-ci.org/github/Edinburgh-Genome-Foundry/topkappy

The CI build worked with the previous release (v4.0.93), six days ago.

pirbo commented

So
This is 2 different issue.
In yarden case the problem was that I forgot to include the binary KappaSwitchman in kappy package and that has been solved.

I double check and KappaSwitchman IS included in the wheel of kappy.4.1.0 for python 3.6 so your case is sadly different and needs more investigation...

pirbo commented

OK I know why:

$ ls -l site-packages/kappy/bin/
total 37412
-rw-r--r-- 1 pirbo pirbo  7134032 sept. 17 19:11 KaMoHa
-rw-r--r-- 1 pirbo pirbo  8596984 sept. 17 19:11 KappaSwitchman
-rw-r--r-- 1 pirbo pirbo 13660472 sept. 17 19:11 KaSaAgent
-rw-r--r-- 1 pirbo pirbo  8908928 sept. 17 19:11 KaSimAgent

The binaries are installed without execution rights!!! Sights... Here we go for yet an other fight against setup.py in order to understand why...

veghp commented

Thank you for the quick reply! I re-ran the CI and the error is definitely gone, but unfortunately there is another one:

E               FileNotFoundError: [Errno 2] No such file or directory: '/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/bin/KappaSwitchman': '/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/bin/KappaSwitchman'

/opt/python/3.6.7/lib/python3.6/subprocess.py:1344: FileNotFoundError

More detail: https://travis-ci.org/github/Edinburgh-Genome-Foundry/topkappy

pirbo commented

Sorry. I set the git tag to the wrong commit :-( There is now a kappy.4.1.2 which should finally be OK... Hopefully!

veghp commented

Thank you, this solved the problem. However, there must have been changes to kappy functions as topkappy still won't run properly which I'll try and sort out. Thanks.