flux-framework / flux-accounting

bank/accounting interface for the Flux resource manager
GNU Lesser General Public License v3.0
3 stars 10 forks source link

ERROR: test/test_job_archive_interface.py - missing test plan #370

Open garlick opened 10 months ago

garlick commented 10 months ago

Problem: as noted here, one of the unit tests is failing for me:

Traceback (most recent call last):
  File "/nfshome/garlick/proj/flux-accounting/src/bindings/python/fluxacct/accounting/./test/test_job_archive_interface.py", line 20, in <module>
    from fluxacct.accounting import job_archive_interface as jobs
  File "/nfshome/garlick/proj/flux-accounting/src/bindings/python/fluxacct/accounting/job_archive_interface.py", line 18, in <module>
    from flux.resource import ResourceSet
ModuleNotFoundError: No module named 'flux'
ERROR: test/test_job_archive_interface.py - missing test plan
ERROR: test/test_job_archive_interface.py - exited with status 1

This is a debian bullseye system with flux-core installed as a system package.

garlick commented 10 months ago

One note: if I run flux make check, the tests work, so perhaps something environmental with the unit tests.

cmoussa1 commented 10 months ago

I wonder if the flux-accounting Python bindings is doing something incorrectly with importing the flux Python module? Sorry, I feel like I am no help here 😩 FWIW, I think the Makefile.am for flux-accounting is the same as flux-sched's fluxion Makefile.am:

SUBDIRS = accounting

install-data-hook:
    $(AM_V_at)echo Linking python modules in non-standard location... && \
      $(INSTALL) -d -m 0755 "$(DESTDIR)$(fluxpylinkdir)" && \
      target=$(fluxpydir) && \
      f=$${target##*/} && \
      cd "$(DESTDIR)$(fluxpylinkdir)" && \
      rm -f $$f && \
      $(LN_S) $$target .

uninstall-local:
    $(AM_V_at)target=$(fluxpydir) && f=$${target##*/} && \
      echo "Removing $(fluxpylinkdir)/$$f" && \
      rm -rf $(fluxpylinkdir)/$$f
garlick commented 10 months ago

I was thinking maybe the python environment for unit tests would be the right place to start looking:

AM_TESTS_ENVIRONMENT = \
        export PYTHONPATH="$(abs_top_srcdir)/src/bindings/python/:$(abs_top_srcdir)/t/pycotap:$(PYTHON_SITE_PKG):$$PYTHONPATH";\
        export PYTHON="${PYTHON}";

https://github.com/flux-framework/flux-accounting/blob/master/src/bindings/python/fluxacct/accounting/Makefile.am#L28

But that looks ok to me. I must be missing something.