swiss-seismological-service / scdetect

A computationally efficient earthquake detection module for SeisComP
https://scdetect.readthedocs.io
GNU Affero General Public License v3.0
15 stars 6 forks source link

test_scdetect_cc_integration failed #116

Closed morealaz closed 2 years ago

morealaz commented 2 years ago

Hi After building with make command, running make test command give following output:

Running tests...
Test project /home/sysop/seiscomp/build
      Start  1: test_core_configuration_files
 1/31 Test  #1: test_core_configuration_files ...................   Passed    0.03 sec
      Start  2: test_core_datetime_time
 2/31 Test  #2: test_core_datetime_time .........................   Passed    0.08 sec
      Start  3: test_core_datetime_timespan
 3/31 Test  #3: test_core_datetime_timespan .....................   Passed    0.06 sec
      Start  4: test_core_georegions
 4/31 Test  #4: test_core_georegions ............................   Passed    0.98 sec
      Start  5: test_core_geolib
 5/31 Test  #5: test_core_geolib ................................   Passed    0.03 sec
      Start  6: test_core_intrusive_list
 6/31 Test  #6: test_core_intrusive_list ........................   Passed    0.02 sec
      Start  7: test_core_refcounts
 7/31 Test  #7: test_core_refcounts .............................   Passed   11.31 sec
      Start  8: test_core_strings
 8/31 Test  #8: test_core_strings ...............................   Passed    0.03 sec
      Start  9: test_core_version
 9/31 Test  #9: test_core_version ...............................   Passed    0.02 sec
      Start 10: test_core_xml
10/31 Test #10: test_core_xml ...................................   Passed    0.02 sec
      Start 11: test_datamodel_cache
11/31 Test #11: test_datamodel_cache ............................   Passed    4.03 sec
      Start 12: test_datamodel_utils
12/31 Test #12: test_datamodel_utils ............................   Passed    0.07 sec
      Start 13: test_io_records_mseedrecord
13/31 Test #13: test_io_records_mseedrecord .....................   Passed    0.06 sec
      Start 14: test_io_recordstream_sdsarchive
14/31 Test #14: test_io_recordstream_sdsarchive .................   Passed    0.10 sec
      Start 15: test_io_streams_filter_lz4
15/31 Test #15: test_io_streams_filter_lz4 ......................   Passed    0.04 sec
      Start 16: test_core_utils_certificate_store
16/31 Test #16: test_core_utils_certificate_store ...............   Passed    0.04 sec
      Start 17: test_core_utils_units
17/31 Test #17: test_core_utils_units ...........................   Passed    0.03 sec
      Start 18: test_core_utils_utils_misc
18/31 Test #18: test_core_utils_utils_misc ......................   Passed    0.03 sec
      Start 19: test_core_utils_url
19/31 Test #19: test_core_utils_url .............................   Passed    0.03 sec
      Start 20: test_gui_tileindex
20/31 Test #20: test_gui_tileindex ..............................   Passed   23.04 sec
      Start 21: static
21/31 Test #21: static ..........................................   Passed    2.61 sec
      Start 22: event
22/31 Test #22: event ...........................................   Passed   18.09 sec
      Start 23: station
23/31 Test #23: station .........................................   Passed   13.90 sec
      Start 24: station-conditional
24/31 Test #24: station-conditional .............................   Passed    2.61 sec
      Start 25: dataselect
25/31 Test #25: dataselect ......................................   Passed   18.01 sec
      Start 26: availability
26/31 Test #26: availability ....................................   Passed   47.56 sec
      Start 27: test_mn_amplitudes
27/31 Test #27: test_mn_amplitudes ..............................   Passed    2.44 sec
      Start 28: test_scdetect_cc_filter_crosscorrelation
28/31 Test #28: test_scdetect_cc_filter_crosscorrelation ........   Passed    0.03 sec
      Start 29: test_scdetect_cc_reducing_amplitude_processor
29/31 Test #29: test_scdetect_cc_reducing_amplitude_processor ...   Passed    0.03 sec
      Start 30: test_scdetect_cc_util_math_cma
30/31 Test #30: test_scdetect_cc_util_math_cma ..................   Passed    0.00 sec
      Start 31: test_scdetect_cc_integration
31/31 Test #31: test_scdetect_cc_integration ....................***Failed    3.32 sec

97% tests passed, 1 tests failed out of 31

Total Test time (real) = 149.24 sec

The following tests FAILED:
     31 - test_scdetect_cc_integration (Failed)

with only test_scdetect_cc_integration failed.

After that before installing with make install command, running ctest -V -R '^test_scdetect_cc.*' in build directory failed test_scdetect_cc_integration with following errors:

[error] Failed to load events: error while opening DDL file: /home/sysop/seiscomp-git/share/db/sqlite3.sql
[error] Failed to load events

But after installing with make install in destination folder which for my case is /home/sysop/seiscomp-git folder, running ctest -V -R '^test_scdetect_cc.*' again in build directory which for my case is /home/sysop/seiscomp/build, passed all the tests including test_scdetect_cc_integration test.

Apparently it try to load events from sqlite3.sql in install destination (/home/sysop/seiscomp-git) before installing and hence it failed since there is nothing there, but after installing it can load events and pass successfully.

damb commented 2 years ago

Thanks again for reporting @morealaz. Very helpful, indeed.

But after installing with make install in destination folder which for my case is /home/sysop/seiscomp-git folder, running ctest -V -R '^test_scdetect_cc.*' again in build directory which for my case is /home/sysop/seiscomp/build, passed all the tests including test_scdetect_cc_integration test.

That's correct and kind of the expected behaviour. Though, I agree, that this is not documented properly. This could (and should!) be improved.

Background: scdetect-cc allows to load EventParameter metadata to be loaded from a file. In order to speed the initialization process up it creates an in-memory SQLite DB and uses the schema from $SEISCOMP_ROOT/share/db/sqlite3.sql to create the tables. Then, the EventParameter data is copied once into the in-memory DB. This way, scdetect-cc can use the SeisComP DB query facilities in order to access the EventParameter metadata (previously copied) during the initialization procedure.

If the $SEISCOMP_ROOT/share/db/sqlite3.sql containing the DDL commands is not available the scdetect-cc integration tests (i.e. test_scdetect_cc_integration) fail, consequently. The file is copied during installation (i.e. while executing e.g. make install).

Does this answer your question and solve your issue?

damb commented 2 years ago

With b44c62d6d11497945fd4a612018798a2ad95a67b I improved the documentation.

morealaz commented 2 years ago

thanks