Skip to content
This repository has been archived by the owner on Sep 1, 2023. It is now read-only.

Python tests fail #784

Closed
chetan51 opened this issue Apr 8, 2014 · 13 comments
Closed

Python tests fail #784

chetan51 opened this issue Apr 8, 2014 · 13 comments
Assignees
Milestone

Comments

@chetan51
Copy link
Contributor

chetan51 commented Apr 8, 2014

When I run the Python tests after building with the new method, I see the following error:

http://pastebin.com/pmV2PbQ2

@breznak
Copy link
Member

breznak commented Apr 8, 2014

Looks like NTA_DATA_PATH needs to be set as well:

  1.                 (datasetPath, os.environ.get('NTA_DATA_PATH',
    
    '')))
  2. E Exception: Unable to locate: extra/gym/gym.csv using
    NTA_DATA_PATH of

I (and most of us) don't run these locally (the DB) so you and Travis are
the first explorers

@chetan51
Copy link
Contributor Author

chetan51 commented Apr 8, 2014

Can we set it automatically, or at least add it to the README?

@breznak
Copy link
Member

breznak commented Apr 8, 2014

If it's a path used in nupic (I guess so?) we could hard-code it to Cmake. But do you need to change it to point to your custom locations of datasets? In that case note to export it in Readme would be imho better. (And probably not necessarily the "main" readme, but Swarming Readme / wiki?)

@chetan51
Copy link
Contributor Author

chetan51 commented Apr 8, 2014

@rhyolight Thoughts?

@david-ragazzi
Copy link
Contributor

And probably not necessarily the "main" readme, but Swarming Readme / wiki?

👍

@rhyolight
Copy link
Member

NTA_DATA_PATH seems to be already set in CMake:

set_environment_variable(NTA_DATA_PATH "${PROJECT_BUILD_RELEASE_DIR}/share/prediction/data" OFF)

This same failure is occurring in the Grok pipelines as well. It seems that env vars set within cmake are not remaining afterwards, even though they all seem to get set when I run locally.

@rhyolight
Copy link
Member

Running tests locally from a fresh shell. I manually unset all nupic-related env vars except for NUPIC.

  • ran cmake
  • ran make
  • ran make tests_run
  • ran make tests_run_all

Got this error:

› make tests_run_all
Scanning dependencies of target tests_run_all
[100%] Python tests + swarming (requires DB)
============================= test session starts ==============================
platform darwin -- Python 2.7.5 -- pytest-2.4.2 -- /usr/bin/python
plugins: cov, xdist
collecting ...
==================================== ERRORS ====================================
___ ERROR collecting tests/integration/py2/nupic/opf/opf_experiments_test.py ___
tests/integration/py2/nupic/opf/opf_experiments_test.py:36: in <module>
>   PREDICTION_DIR = os.path.join(os.environ['NTA'], 'share', 'opf')
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/UserDict.py:23: in __getitem__
>       raise KeyError(key)
E       KeyError: 'NTA'
!!!!!!!!!!!!!!!!!!!! Interrupted: stopping after 1 failures !!!!!!!!!!!!!!!!!!!!
=========================== 1 error in 0.79 seconds ============================
make[3]: *** [CMakeFiles/tests_run_all] Error 2
make[2]: *** [CMakeFiles/tests_run_all.dir/all] Error 2
make[1]: *** [CMakeFiles/tests_run_all.dir/rule] Error 2
make: *** [tests_run_all] Error 2```

Looks like NTA is not set:

› env | grep NTA
NOTHING

But when I start a fresh shell...

› env | grep NTA
NTA=/Users/mtaylor/nta/nupic/build/release
NTA_ROOTDIR=/Users/mtaylor/nta/nupic/build/release
NTA_DATA_PATH=/Users/mtaylor/nta/nupic/build/release/share/prediction/data
NTA_ROOT_DIR=/Users/mtaylor/nta/nupic/build/release

So the environment variables are getting set, but not within the shell environment where cmake ran? @david-ragazzi do you understand this?

@breznak
Copy link
Member

breznak commented Apr 9, 2014

@rhyolight You probably added those lines to .bashrc, in the old shell
they are not exported, unless you run: source ~/.bashrc
in each fresh shell bashrc is sourced at beginning, so they're exported

@rhyolight
Copy link
Member

@breznak yes, that was it.

@rhyolight rhyolight added this to the Sprint 19 milestone Apr 9, 2014
@david-ragazzi
Copy link
Contributor

@rhyolight You probably added those lines to .bashrc, in the old shell
they are not exported, unless you run: source ~/.bashrc
in each fresh shell bashrc is sourced at beginning, so they're exported

👍

@rhyolight
Copy link
Member

@chetan51 The README already has the instruction:

export NTA_ROOT_DIR=$NTA

Is this sufficient for you to close this ticket?

We have a PR to remote NTA_ROOT_DIR entirely now, too: #787

@chetan51
Copy link
Contributor Author

chetan51 commented Apr 9, 2014

I thought this failure is happening because NTA_DATA_PATH is not set?

@rhyolight
Copy link
Member

@chetan51 Sorry, it's been a long day.

I don't understand why this is failing for you, though. Everything works for me. Can anyone else replicate this failure?

@rhyolight rhyolight self-assigned this Apr 11, 2014
@rhyolight rhyolight modified the milestones: Sprint 20, Sprint 19 Apr 11, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants