idaholab / civet

Continuous Integration, Verification, Enhancement, and Testing
Apache License 2.0
35 stars 14 forks source link

moose modules unit testing not occurring #487

Open WilkAndy opened 4 years ago

WilkAndy commented 4 years ago

I'm pretty sure i've written a similar idaholab/moose issue in the past few months, but couldn't find it, so sorry for the duplicate if there is one!

CIVET isn't running any of the modules unit tests. For instance:

BUILD_ROOT/moose/modules/geochemistry/unit/: make -j 12
find: '/opt/civet/build_0/moose/modules/geochemistry/unit/include': No such file or directory
Rebuilding symlinks in /opt/civet/build_0/moose/modules/geochemistry/unit/build/header_symlinks
Compiling C++ with suffix (in dbg mode) /opt/civet/build_0/moose/modules/module_loader/src/ModulesApp.C...
Checking if header needs updating: /opt/civet/build_0/moose/modules/geochemistry/unit/include/Geochemistry-unitRevision.h...
Compiling C++ (in dbg mode) /opt/civet/build_0/moose/modules/geochemistry/unit/src/GeochemicalDatabaseValidatorTest.C...
Compiling C++ (in dbg mode) /opt/civet/build_0/moose/modules/geochemistry/unit/src/GeochemistryActivityCoefficientsDebyeHuckelTest.C...
Compiling C++ (in dbg mode) /opt/civet/build_0/moose/modules/geochemistry/unit/src/GeochemistrySortedIndicesTest.C...
Compiling C++ (in dbg mode) /opt/civet/build_0/moose/modules/geochemistry/unit/src/GeochemicalSystemTest.C...
Compiling C++ (in dbg mode) /opt/civet/build_0/moose/modules/geochemistry/unit/src/GeochemicalDatabaseReaderTest.C...
Compiling C++ (in dbg mode) /opt/civet/build_0/moose/modules/geochemistry/unit/src/MinimalGeochemicalSystemTest.C...
Compiling C++ (in dbg mode) /opt/civet/build_0/moose/modules/geochemistry/unit/src/GeochemistryKineticRateCalculatorTest.C...
Compiling C++ (in dbg mode) /opt/civet/build_0/moose/modules/geochemistry/unit/src/GeochemistrySpeciesSwapperTest.C...
Compiling C++ (in dbg mode) /opt/civet/build_0/moose/modules/geochemistry/unit/src/EquilibriumConstantInterpolatorTest.C...
Compiling C++ (in dbg mode) /opt/civet/build_0/moose/modules/geochemistry/unit/src/GeochemistryIonicStrengthTest.C...
Compiling C++ (in dbg mode) /opt/civet/build_0/moose/modules/geochemistry/unit/src/GeochemistryFormattedOutputTest.C...
Compiling C++ (in dbg mode) /opt/civet/build_0/moose/modules/geochemistry/unit/src/GeochemicalSolverTest.C...
Compiling C++ (in dbg mode) /opt/civet/build_0/moose/modules/geochemistry/unit/src/GeochemistryActivityCalculatorsTest.C...
Compiling C++ (in dbg mode) /opt/civet/build_0/moose/modules/geochemistry/unit/src/main.C...
Linking Library /opt/civet/build_0/moose/modules/module_loader/lib/libmodule_loader_with_gc-dbg.la...
Linking Library /opt/civet/build_0/moose/modules/geochemistry/unit/test/lib/libgeochemistry-unit_test-dbg.la...
Linking Library /opt/civet/build_0/moose/modules/geochemistry/unit/lib/libgeochemistry-unit-dbg.la...
Linking Executable /opt/civet/build_0/moose/modules/geochemistry/unit/geochemistry-unit-dbg...
BUILD_ROOT/moose/modules/geochemistry/unit/: ./run_tests
[==========] Running 0 tests from 0 test cases.
[==========] 0 tests from 0 test cases ran. (0 ms total)
[  PASSED  ] 0 tests.

and similar for all the other modules. In the geochemistry module there are ~200 tests that really need to be run for every PR.

brianmoose commented 4 years ago

I'm not in the loop anymore but I still get alerted for civet issues, and since I have nothing better to do with my life, I took a look. :)

This doesn't seem to be a civet issue though. Just building the geochemistry unit test executable and running it manually shows that no tests are run. In fact, it appears that the lib/libgeochemistry-unit-opt.so (where all the tests are) is not even linked to the executable (as verified by ldd) even though it definitely is on the link line. This might be due to nothing actually referencing the symbols in libgeochemistry-unit-opt.so so the linker just silently drops it. Forcing the linkage by, for example, putting a dummy function in one of the unit test source files and calling it from main(), gets the unit tests running again. So it seems it is a moose build issue and no way am I going to try to figure that out :)

brianmoose commented 4 years ago

By the way, moose/unit is not affected by this because it does reference functions in libmoose-unit-opt.so when main() calls registerApp(MooseUnitApp). The modules don't have separate unit test apps, so they just call registerApp(<Module>App)

WilkAndy commented 4 years ago

Thanks for this detective work, @brianmoose . I'm now doing some of my own - will report here if i find anything which is very unlikely since i'm not experienced in this sort of thing.

WilkAndy commented 4 years ago

I can't replicate what i think you're reporting:

moose/modules/geochemistry/unit/> METHOD=dbg make -j 2
moose/modules/geochemistry/unit/> ./geochemistry-unit-dbg

runs my unit tests

brianmoose commented 4 years ago

What OS are you running? Might just be a linux thing...

WilkAndy commented 4 years ago

MacOS