MolSSI / QCFractal

A distributed compute and database platform for quantum chemistry.
https://molssi.github.io/QCFractal/
BSD 3-Clause "New" or "Revised" License
144 stars 47 forks source link

remove or patch geoip2 tests #718

Closed loriab closed 11 months ago

loriab commented 2 years ago

Describe the bug

Non-urgent reminder issue that a couple geoip2 tests off next are probably missing their base data. Run from a pip install -e'd qcf repo with geoip2 present in the conda env.

Close if I've analyzed wrong, or ignore as long as you'd like if right.

============================================================================================================= FAILURES =============================================================================================================
___________________________________________________________________________________________________ test_serverinfo_socket_geoip ___________________________________________________________________________________________________

storage_socket = <qcfractal.db_socket.socket.SQLAlchemySocket object at 0x7fffd61d7d30>

    def test_serverinfo_socket_geoip(storage_socket: SQLAlchemySocket):
>       ip_data = load_ip_test_data()

QCFractal/qcfractal/components/serverinfo/test_access_socket.py:25: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def load_ip_test_data():
        """
        Loads data for testing IP logging
        """

        file_path = os.path.join(_my_path, "MaxMind-DB", "source-data", "GeoIP2-City-Test.json")

>       with open(file_path, "r") as f:
E       FileNotFoundError: [Errno 2] No such file or directory: '/storage/hive/project/chem-sherrill/lburns7/gits/QCFractal/qcfractaltesting/MaxMind-DB/source-data/GeoIP2-City-Test.json'

QCFractal/qcfractaltesting/helpers.py:146: FileNotFoundError
-------------------------------------------------------------------------------------------------------- Captured log setup --------------------------------------------------------------------------------------------------------
WARNING  qcfractal.components.serverinfo.sockets:sockets.py:58 Cannot import geoip2 module. To use API access logging, you need to install it manually using `pip install geoip2`
________________________________________________________________________________________________ test_serverinfo_socket_save_access ________________________________________________________________________________________________

storage_socket = <qcfractal.db_socket.socket.SQLAlchemySocket object at 0x7fffd5927970>

    def test_serverinfo_socket_save_access(storage_socket: SQLAlchemySocket):
>       ip_data = load_ip_test_data()

QCFractal/qcfractal/components/serverinfo/test_access_socket.py:51: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def load_ip_test_data():
        """
        Loads data for testing IP logging
        """

        file_path = os.path.join(_my_path, "MaxMind-DB", "source-data", "GeoIP2-City-Test.json")

>       with open(file_path, "r") as f:
E       FileNotFoundError: [Errno 2] No such file or directory: '/storage/hive/project/chem-sherrill/lburns7/gits/QCFractal/qcfractaltesting/MaxMind-DB/source-data/GeoIP2-City-Test.json'

QCFractal/qcfractaltesting/helpers.py:146: FileNotFoundError
-------------------------------------------------------------------------------------------------------- Captured log setup --------------------------------------------------------------------------------------------------------
WARNING  qcfractal.components.serverinfo.sockets:sockets.py:58 Cannot import geoip2 module. To use API access logging, you need to install it manually using `pip install geoip2`
===================================================================================================== short test summary info ======================================================================================================
FAILED QCFractal/qcfractal/components/serverinfo/test_access_socket.py::test_serverinfo_socket_geoip - FileNotFoundError: [Errno 2] No such file or directory: '/storage/hive/project/chem-sherrill/lburns7/gits/QCFractal/qcfrac...
FAILED QCFractal/qcfractal/components/serverinfo/test_access_socket.py::test_serverinfo_socket_save_access - FileNotFoundError: [Errno 2] No such file or directory: '/storage/hive/project/chem-sherrill/lburns7/gits/QCFractal/...
===================================================================================== 2 failed, 896 passed, 104 skipped in 1872.91s (0:31:12) ======================================================================================

To Reproduce

Expected behavior

Additional context

bennybp commented 2 years ago

Good point. In GHA I clone the test repo, but the test should fail more gracefully

See: https://github.com/MolSSI/QCFractal/blob/104dff4703d00d9ab0761085ac415166f8039f86/.github/workflows/core_tests.yml#L33-L37