Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot run tests in local source directory due to non-standard directory structure #11

Open
avinson opened this issue Feb 20, 2018 · 2 comments

Comments

@avinson
Copy link
Contributor

avinson commented Feb 20, 2018

Because the various probcomp repos utilize a src/ directory instead of a <MODULE_NAME>/ directory, tests cannot be run from within the repo directories themselves. Adding a symlink (e.g. ln -s src crosscat) fixes this issue but this workaround may have other side-effects. It would be preferable to update the directory structures. cc: @fsaad @zane @Schaechtle

$ make crosscat-test
====================================================================== test session starts =======================================================================
platform linux2 -- Python 2.7.11, pytest-2.8.5, py-1.5.2, pluggy-0.3.1
rootdir: /home/jovyan/crosscat, inifile:
collected 106 items

. ..........................................................................................................

=================================================================== 106 passed in 6.99 seconds ===================================================================
$ make crosscat-dev


Package plan for package removal in environment /opt/conda/envs/python2:

The following packages will be REMOVED:

    crosscat: 2017.12.05-0 probcomp/label/edge

$ make crosscat-test
====================================================================== test session starts =======================================================================
platform linux2 -- Python 2.7.11, pytest-2.8.5, py-1.5.2, pluggy-0.3.1
rootdir: /home/jovyan/crosscat, inifile:

================================================================== no tests ran in 0.05 seconds ==================================================================
ERROR: file or package not found: crosscat
make: *** [crosscat-test] Error 4

add symlink:

 2018-02-19 23:55:35 ⌚  avinson-notebook in ~/crosscat
○ → ln -s src crosscat

now fixed:

 $ make crosscat-test
====================================================================== test session starts =======================================================================
platform linux2 -- Python 2.7.11, pytest-2.8.5, py-1.5.2, pluggy-0.3.1
rootdir: /home/jovyan/crosscat, inifile:
collected 106 items

crosscat/tests/unit_tests/test_col_ensure.py .....................
crosscat/tests/unit_tests/test_continuous_component_model.py .....................
crosscat/tests/unit_tests/test_general_utils.py ...
crosscat/tests/unit_tests/test_multinomial_component_model.py .......................
crosscat/tests/unit_tests/test_pred_prob.py ....
crosscat/tests/unit_tests/test_quality_test_utils.py ...............
crosscat/tests/unit_tests/test_synthetic_data_generator.py ...................

=================================================================== 106 passed in 8.32 seconds ===================================================================
@avinson
Copy link
Contributor Author

avinson commented Feb 20, 2018

related: #1

@fsaad
Copy link

fsaad commented Feb 20, 2018

tests cannot be run from within the repo directories themselves.

As mentioned in #1, all tests should be run using ./check.sh which takes care to (i) build the latest source and places it into build/ and (ii) add the build directory to the python path.

All the probcomp repositories should come equipped with ./check.sh --- let me know if any are missing.

It would be preferable to update the directory structures

There is no plan to change the directory structures from src/ for any existing repository (there are good reasons for why we made this design originally, and will not revert it).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants