FluidityProject / fluidity

Fluidity
http://fluidity-project.org
Other
365 stars 115 forks source link

make unittest assertionerror1 #309

Closed shihaopku closed 3 years ago

shihaopku commented 3 years ago

When I have installed and configured the Fluidity, I try to run make unittest, but there is an assertionerror and I'm not sure what happened.

It shows

RUN bin/test Traceback (most recent call last): File "bin/unittestharness", line 216 in <module> assert float(version('junit_xml') >= 1.9) Assertionerror: Please update junit_xml

However, I can't find where the 'junit_xml' is, and what this file is. I am wondering if anyone can help. Thanks a lot.

Patol75 commented 3 years ago

unittestharness.py has been re-written recently; more details can be found in #287. For what concerns junit_xml, it is a Python package which we use to generate a report that Jenkins can interpret. junit_xml is not required to run unittestharness.py - simply omit the -x argument and the script should avoid the assertion.

shihaopku commented 3 years ago

Thanks a lot! Although I didn't understand the method of 'simply omiting the -x argument', I updated junit-xml and it works! It shows Passes: 18164 Failures: 1 ['test_invert'] Errors: 3 ['test_vertical_prolongation_operator', 'test_vertical_extrapolation', 'test_vertical_integration'] I am wondering how to deal with these failures and errors, so as to avoid them and get all passes.

Best Wishes.

Patol75 commented 3 years ago

I am assuming that you have run make unittest. Now, being at the root of the Fluidity directory, you should have a tests directory under bin. If so, you can simply execute tools/unittestharness.py -t TEST where TEST is, for example, test_invert. This should give you a Traceback regarding why the tests you report are failing.

If you do not have the tests directory under bin, you can still run tests individually by additionally providing the directory where they are located. For example, in the case of test_invert, tools/unittestharness.py --dir femtools/tests -t test_invert.

shihaopku commented 3 years ago

Thanks a lot for your help! When I ran tools/unittestharness.py -t test_invert as your instruction, I got 5 passes and no failre or error. It seems quite strange because run unittest there did show a failure. haha. When I ran 'test_vertical_prolongation_operator', 'test_vertical_extrapolation', 'test_vertical_integration', I got 1 error respectively. Here is the error message: Error Message: Error: GMSH mesh version must be 2.x When running make test, this error also occurred. Do you have any advice about how to deal with it?

Best Wishes!

Patol75 commented 3 years ago

What is the output of gmsh --version?

shihaopku commented 3 years ago

4.4.1

Patol75 commented 3 years ago

Fluidity does not currently support GMSH 4 (have a look at #235). The failures you report should disappear if you use GMSH 3.

shihaopku commented 3 years ago

Thanks for your help! It works now!