Yes, that is the situation.m42kus wrote: ↑Mon May 27, 2019 12:00 pmHi, this will definitely be relevant for me at some point. If I understood correctly the status right now is that all tests run successfully except a few tests of the Path Workbench because they make use of the Gui module which can't be used in the windows virtual environment?abdullah wrote: ↑Wed May 22, 2019 12:04 pm There are two reasons why are I posting:
1. I would like to have more verbosity when unit tests fail. Currently the why is rather hidden. See for example:
https://travis-ci.org/FreeCAD/FreeCAD/b ... tification
2. If you are going to work both unit tests and CI, in particular Travis, this may be relevant for you.
The thread were I log my tests is:
https://forum.freecadweb.org/viewtopic. ... &start=130
However, take with a grain of salt what I wrote, because in the meantime I discovered the following:
git-bash is not a "proper" windows console. When Python is used therein (apparently a Python compiled with ncurses), the output is mangled: incomplete and out of the real order. To solve this, one can use winpty, which is bundled with git-bash. However, winpty requires, without options, a proper windows console, which git-bash is not, and it will through an error "stdin is not a tty". Nevertheless, when using winpty with the flag "-Xallow-non-tty", one can by-pass the check of whether it is a proper tty. However, it generates problems when it tries to rewind, which you can do with a tty, but not with a file. You can the use the winpty flag, "-Xplain" for this. Those flags are not documented and can only be found in the code of winpty. In any case, when winpty is executed like this, the screen output is beautiful (well just correct, but after having seen it wrong, it looks beautiful to me), the exit code (return code) of FreeCADCmd is not passed correctly to git-bash, so it detects it as "return 0 - success" even if tests fail. The solution I found is to use tee to put the same content that goes to the screen to a file, then grep is used against this file to search for FAILED and make the build fail if found (I am currently missing the -q flag to grep to make it quiet and avoid duplicating the FAILED line to the screen).
So, all-in-all. The output is ok now:
https://travis-ci.org/FreeCAD/FreeCAD/jobs/537777414
There some FEM and Path test that fail, but now we know why!! (yes, I know it sounds stupid, but some days ago I felt like the guys in the 50s searching for actual bugs in the relays):
Code: Select all
======================================================================
ERROR: test_pyimport_all_FEM_modules (femtest.testcommon.TestFemCommon)
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\Users\travis\build\FreeCAD\FreeCAD\build\Mod\Fem\femtest\testcommon.p
y", line 113, in test_pyimport_all_FEM_modules
__import__('{0}'.format(mod))
File "C:\Users\travis\build\FreeCAD\FreeCAD\build\Mod\Fem\feminout\importFenic
sMesh.py", line 34, in <module>
import FreeCADGui
ImportError: DLL load failed: The specified module could not be found.
======================================================================
ERROR: TestPathApp (unittest.loader._FailedTest)
----------------------------------------------------------------------
ImportError: Failed to import test module: TestPathApp
Traceback (most recent call last):
File "C:\Users\travis\build\FreeCAD\FreeCAD\build\bin\lib\unittest\loader.py",
line 153, in loadTestsFromName
module = __import__(module_name)
File "C:\Users\travis\build\FreeCAD\FreeCAD\build\Mod\Path\TestPathApp.py", li
ne 33, in <module>
from PathTests.TestPathDepthParams import depthTestCases
File "C:\Users\travis\build\FreeCAD\FreeCAD\build\Mod\Path\PathTests\TestPathD
epthParams.py", line 25, in <module>
import PathScripts.PathUtils as PU
File "C:\Users\travis\build\FreeCAD\FreeCAD\build\Mod\Path\PathScripts\PathUti
ls.py", line 26, in <module>
import FreeCADGui
ImportError: DLL load failed: The specified module could not be found.
So maybe it is not so relevant for you after all.