Page MenuHomeSoftware Heritage

Makefile.local: add dependency between test and ts-build-so targets
ClosedPublic

Authored by anlambert on Aug 19 2021, 4:46 PM.

Details

Summary

For some reasons, I have the following error when calling make test.

python3 -m pytest  .
============================================================================================== test session starts ===============================================================================================
platform linux -- Python 3.9.2, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
rootdir: /home/anlambert/swh/swh-environment/swh-search, configfile: pytest.ini
plugins: django-4.4.0, mock-3.6.1, flask-1.2.0, hypothesis-6.14.7, requests-mock-1.9.3, redis-2.1.1, forked-1.3.0, asyncio-0.15.1, postgresql-2.6.1, django-test-migrations-1.1.0, xdist-2.3.0, dash-1.21.0, swh.core-0.14.4, swh.journal-0.8.0
collected 0 items / 1 error                                                                                                                                                                                      

===================================================================================================== ERRORS =====================================================================================================
_________________________________________________________________________________________ ERROR collecting test session __________________________________________________________________________________________
../../../.virtualenvs/swh/lib/python3.9/site-packages/_pytest/config/__init__.py:570: in _importconftest
    mod = import_path(conftestpath, mode=importmode)
../../../.virtualenvs/swh/lib/python3.9/site-packages/_pytest/pathlib.py:544: in import_path
    raise ImportPathMismatchError(module_name, module_file, path)
E   _pytest.pathlib.ImportPathMismatchError: ('swh.search.tests.conftest', '/home/anlambert/swh/swh-environment/swh-search/swh/search/tests/conftest.py', PosixPath('/home/anlambert/swh/swh-environment/swh-search/build/lib/swh/search/tests/conftest.py'))
============================================================================================ short test summary info =============================================================================================
ERROR  - _pytest.pathlib.ImportPathMismatchError: ('swh.search.tests.conftest', '/home/anlambert/swh/swh-environment/swh-search/swh/search/tests/conftest.py', PosixPath('/home/anlambert/swh/swh-environment/s...
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
================================================================================================ 1 error in 0.44s ================================================================================================

Setting TEST_DIRS in Makefile.local fix that issue.

Also make test target depends on ts-build-so one as tests will fail if the swh_ql.so file does not get loaded.

Diff Detail

Repository
rDSEA Archive search
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Build is green

Patch application report for D6117 (id=22132)

Rebasing onto db47029f6c...

Current branch diff-target is up to date.
Changes applied before test
commit 1f0999f5e32fa89cf7fa8a95b145838bca09db15
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Thu Aug 19 16:42:49 2021 +0200

    Makefile.local: Fix make test command and add dependency to ts-build-so

See https://jenkins.softwareheritage.org/job/DSEA/job/tests-on-diff/270/ for more details.

anlambert retitled this revision from Makefile.local: Fix make test command and add dependency to ts-build-so For some reasons, I have the following error when calling `make test`. ``` python3 -m pytest . to Makefile.local: Fix make test command and add dependency to ts-build-soFor some reasons, I have the following error when calling `make test`.```python3 -m pytest ..Aug 19 2021, 4:50 PM
anlambert edited the summary of this revision. (Show Details)
anlambert retitled this revision from Makefile.local: Fix make test command and add dependency to ts-build-soFor some reasons, I have the following error when calling `make test`.```python3 -m pytest . to Makefile.local: Fix make test command and add dependency to ts-build-so.Aug 19 2021, 4:52 PM
anlambert edited the summary of this revision. (Show Details)

I don't think that issue is specific to swh-search, I have it with other packages from time to time. rm build/ -rf should fix it.

I don't think that issue is specific to swh-search, I have it with other packages from time to time. rm build/ -rf should fix it.

Yes it worked, thanks for the tip. I will update the diff to only add make target dependencies then.

Remove TEST_DIRS modification.

anlambert retitled this revision from Makefile.local: Fix make test command and add dependency to ts-build-so to Makefile.local: add dependency between test and ts-build-so targets.Aug 19 2021, 4:58 PM

Build is green

Patch application report for D6117 (id=22133)

Rebasing onto db47029f6c...

Current branch diff-target is up to date.
Changes applied before test
commit 26f800cde3cf8d198a7f325334cebdfe96ffd31f
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Thu Aug 19 16:42:49 2021 +0200

    Makefile.local: add dependency between test and ts-build-so targets
    
    The swh_sql.so file must be built prior running the tests.

See https://jenkins.softwareheritage.org/job/DSEA/job/tests-on-diff/271/ for more details.

This revision is now accepted and ready to land.Aug 19 2021, 5:05 PM