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

CI does not fail for certain test cases #32

Open
BenjaminRodenberg opened this issue Mar 10, 2025 · 2 comments
Open

CI does not fail for certain test cases #32

BenjaminRodenberg opened this issue Mar 10, 2025 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@BenjaminRodenberg
Copy link
Member

In #28 I observed some failing tests locally that were not detected by the CI. Locally I get the following error if using e338d4b:

$ python3 setup.py test
...
ERROR: test_scalar_write (tests.integration.test_write_read.TestWriteandReadData.test_scalar_write)
Test to check if Adapter function write() passes correct parameters to the API function write_block_scalar_data()
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.12/unittest/mock.py", line 1843, in _inner
    return f(*args, **kw)
           ^^^^^^^^^^^^^^
  File "/home/benjamin/Programming/fenicsx-adapter/tests/integration/test_write_read.py", line 67, in test_scalar_write
    precice.initialize(right_boundary, self.scalar_V, self.scalar_function)
  File "/home/benjamin/Programming/fenicsx-adapter/fenicsxprecice/fenicsxprecice.py", line 298, in initialize
    if self._fenicsx_dims != self._participant.get_mesh_dimensions(self._config.get_coupling_mesh_name()):
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Participant' object has no attribute 'get_mesh_dimensions'. Did you mean: 'get_dimensions'?

The error originates from the fact that we define a mock for get_dimensions (outdated API function) while the function initialize in fenicsxprecice.py expects get_mesh_dimensions. In bf5eda2 I fixed this issue by providing a mock for get_mesh_dimensions. Using bf5eda2 the tests work as expected locally and in the CI.

The reason for opening this issue is that (in contrast to my expectation and when running locally) the tests pass when using the CI for e338d4b.

@BenjaminRodenberg BenjaminRodenberg added the bug Something isn't working label Mar 10, 2025
@BenjaminRodenberg BenjaminRodenberg self-assigned this Mar 10, 2025
@NiklasVin
Copy link
Collaborator

Locally I ran the tests locally the same way as specified in the CI pipeline and all tests passed. However, when calling it with python3 setup.py test I get the error Test correct checkpoint storing ... (0) 16:30:09 [xml::XMLParser]:173 in readXmlFile: ERROR: XML parser was unable to open configuration file "path/fenicsx-adapter/tests/dummy.xml"

@BenjaminRodenberg
Copy link
Member Author

I tried to reproduce the behavior of the CI using the following Dockerfile:

FROM dolfinx/dolfinx:v0.9.0

RUN git clone https://github.com/precice/fenicsx-adapter.git

WORKDIR fenicsx-adapter
RUN git checkout i32

RUN pip install setuptools==71.0.0
RUN mkdir -p precice
RUN echo "from setuptools import setup" >> precice/setup.py
RUN echo "setup(name='pyprecice', version='3.0.0')" >> precice/setup.py
RUN python3 -m pip install ./precice/
RUN python3 setup.py test -s tests.unit
RUN python3 setup.py test -s tests.integration

Running docker build . from the directory where the Dockerfile is stored also triggers the error from above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants