AntelopeIO / DUNES

Docker Utilities for Node Execution
Other
26 stars 17 forks source link

DUNE test test_project.py fails #85

Closed mikelik closed 1 year ago

mikelik commented 1 year ago

When running following test https://github.com/AntelopeIO/DUNE/blob/1bce6e7004443ddf76013ec7ebfb142213804ca9/tests/test_project.py on my machine it fails:

mikel@msi:~/repo/DUNE/tests$ pytest test_project.py 
========================================================= test session starts ==========================================================
platform linux -- Python 3.8.10, pytest-7.2.0, pluggy-0.13.0
rootdir: /home/mikel/repo/DUNE/tests
collected 4 items                                                                                                                      

test_project.py .FF.                                                                                                             [100%]

=============================================================== FAILURES ===============================================================
_________________________________________________________ test_create_bare_app _________________________________________________________

    def test_create_bare_app():
        """Test `--create-bare-app` key."""

        remove_existing()

        # Expected file list.
        filelist = [TEST_APP_DIR + '/',
                    TEST_APP_DIR + '/' + PROJECT_NAME + '.hpp',
                    TEST_APP_DIR + '/' + PROJECT_NAME + '.cpp',
                    TEST_APP_DIR + '/' + PROJECT_NAME + '.contracts.md',
                    TEST_APP_DIR + '/README.txt']

        subprocess.run([DUNE_EXE, "--create-bare-app", PROJECT_NAME, TEST_PATH], check=True)
>       assert os.path.isdir(TEST_APP_DIR) is True
E       AssertionError: assert False is True
E        +  where False = <function isdir at 0x7fcd55c17dc0>('/home/mikel/repo/DUNE/tests/test_app')
E        +    where <function isdir at 0x7fcd55c17dc0> = <module 'posixpath' from '/usr/lib/python3.8/posixpath.py'>.isdir
E        +      where <module 'posixpath' from '/usr/lib/python3.8/posixpath.py'> = os.path

test_project.py:83: AssertionError
_________________________________________________________ test_cmake_and_ctest _________________________________________________________

    def test_cmake_and_ctest():
        """Test `--cmake` and `--ctest` key."""

        remove_existing()

        # Create the cmake app, test it exists.
        subprocess.run([DUNE_EXE, "--create-cmake-app", PROJECT_NAME, TEST_PATH], check=True)
>       assert os.path.isdir(TEST_APP_DIR) is True
E       AssertionError: assert False is True
E        +  where False = <function isdir at 0x7fcd55c17dc0>('/home/mikel/repo/DUNE/tests/test_app')
E        +    where <function isdir at 0x7fcd55c17dc0> = <module 'posixpath' from '/usr/lib/python3.8/posixpath.py'>.isdir
E        +      where <module 'posixpath' from '/usr/lib/python3.8/posixpath.py'> = os.path

test_project.py:105: AssertionError
======================================================= short test summary info ========================================================
FAILED test_project.py::test_create_bare_app - AssertionError: assert False is True
FAILED test_project.py::test_cmake_and_ctest - AssertionError: assert False is True
===================================================== 2 failed, 2 passed in 2.31s ======================================================
mikel@msi:~/repo/DUNE/tests$ 
mikelik commented 1 year ago

I have managed to reproduce this issue with following command line:

/home/mikel/repo/DUNE/dune --create-cmake-app test_app /home/mikel/repo/DUNE/tests && ls test_app && rm -rf /home/mikel/repo/DUNE/tests/test_app &&  /home/mikel/repo/DUNE/dune --create-bare-app test_app /home/mikel/repo/DUNE/tests && ls test_app && rm -rf /home/mikel/repo/DUNE/tests/test_app && /home/mikel/repo/DUNE/dune --create-cmake-app test_app /home/mikel/repo/DUNE/tests && ls test_app

The second ls test_app fails in my case.

mikelik commented 1 year ago

Merged to functional tests and later to main.