testsuit 0.1.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (213) hide show
  1. testsuit-0.1.1/.editorconfig +19 -0
  2. testsuit-0.1.1/.github/workflows/publish.yml +58 -0
  3. testsuit-0.1.1/.github/workflows/tests.yml +72 -0
  4. testsuit-0.1.1/.gitignore +19 -0
  5. testsuit-0.1.1/CONTRIBUTING.md +118 -0
  6. testsuit-0.1.1/LICENSE +201 -0
  7. testsuit-0.1.1/PKG-INFO +165 -0
  8. testsuit-0.1.1/README.md +111 -0
  9. testsuit-0.1.1/examples/acme_testbench/.gitignore +5 -0
  10. testsuit-0.1.1/examples/acme_testbench/README.md +124 -0
  11. testsuit-0.1.1/examples/acme_testbench/pyproject.toml +37 -0
  12. testsuit-0.1.1/examples/acme_testbench/sample/data/bench_run_01.acmej +253 -0
  13. testsuit-0.1.1/examples/acme_testbench/sample/data/drive_line.sim.yml +14 -0
  14. testsuit-0.1.1/examples/acme_testbench/sample/data/oil_skid_01.csv +243 -0
  15. testsuit-0.1.1/examples/acme_testbench/sample/datapack/archive_store/v1.2/calibration.yml +6 -0
  16. testsuit-0.1.1/examples/acme_testbench/sample/datapack/archive_store/v1.2/dataset.dico +3 -0
  17. testsuit-0.1.1/examples/acme_testbench/sample/datapack/setup/acme_setup.yml +48 -0
  18. testsuit-0.1.1/examples/acme_testbench/sample/datapack/setup/globals.dico +2 -0
  19. testsuit-0.1.1/examples/acme_testbench/sample/datapack/setup/templates/bench_config.yml +6 -0
  20. testsuit-0.1.1/examples/acme_testbench/sample/datapack/testdef/acme_testdef.yml +8 -0
  21. testsuit-0.1.1/examples/acme_testbench/sample/datapack/testdef/versions.dico +2 -0
  22. testsuit-0.1.1/examples/acme_testbench/sample/exploit.yml +11 -0
  23. testsuit-0.1.1/examples/acme_testbench/sample/scenario/bench_session/testrun_01/bench_checks.mexploit.yml +39 -0
  24. testsuit-0.1.1/examples/acme_testbench/sample/scenario/bench_session/testrun_02/oil_skid_checks.mexploit.yml +20 -0
  25. testsuit-0.1.1/examples/acme_testbench/src/acme_testbench/__init__.py +8 -0
  26. testsuit-0.1.1/examples/acme_testbench/src/acme_testbench/assets/acme_logo.svg +23 -0
  27. testsuit-0.1.1/examples/acme_testbench/src/acme_testbench/checks.py +55 -0
  28. testsuit-0.1.1/examples/acme_testbench/src/acme_testbench/cli.py +159 -0
  29. testsuit-0.1.1/examples/acme_testbench/src/acme_testbench/criteria.py +137 -0
  30. testsuit-0.1.1/examples/acme_testbench/src/acme_testbench/filemgrs.py +232 -0
  31. testsuit-0.1.1/examples/acme_testbench/src/acme_testbench/importer.py +118 -0
  32. testsuit-0.1.1/examples/acme_testbench/src/acme_testbench/plugin.py +41 -0
  33. testsuit-0.1.1/examples/acme_testbench/tests/conftest.py +14 -0
  34. testsuit-0.1.1/examples/acme_testbench/tests/etc/exploit_nok.yml +7 -0
  35. testsuit-0.1.1/examples/acme_testbench/tests/etc/nok_scenario/testrun_01/nok_checks.mexploit.yml +10 -0
  36. testsuit-0.1.1/examples/acme_testbench/tests/test_cli.py +73 -0
  37. testsuit-0.1.1/examples/acme_testbench/tests/test_criteria.py +81 -0
  38. testsuit-0.1.1/examples/acme_testbench/tests/test_datapack.py +75 -0
  39. testsuit-0.1.1/examples/acme_testbench/tests/test_exploit_runner.py +41 -0
  40. testsuit-0.1.1/examples/acme_testbench/tests/test_formats.py +85 -0
  41. testsuit-0.1.1/examples/config_extract_data_any.json +26 -0
  42. testsuit-0.1.1/pyproject.toml +97 -0
  43. testsuit-0.1.1/setup.cfg +4 -0
  44. testsuit-0.1.1/src/testsuit/__init__.py +15 -0
  45. testsuit-0.1.1/src/testsuit/cli/__init__.py +0 -0
  46. testsuit-0.1.1/src/testsuit/cli/apply_clock_correction.py +167 -0
  47. testsuit-0.1.1/src/testsuit/cli/data2db.py +82 -0
  48. testsuit-0.1.1/src/testsuit/cli/data2h5.py +168 -0
  49. testsuit-0.1.1/src/testsuit/cli/datapack.py +46 -0
  50. testsuit-0.1.1/src/testsuit/cli/evalfile.py +88 -0
  51. testsuit-0.1.1/src/testsuit/cli/exploit_runner.py +122 -0
  52. testsuit-0.1.1/src/testsuit/cli/extract_data_any.py +307 -0
  53. testsuit-0.1.1/src/testsuit/cli/extract_data_flags.py +249 -0
  54. testsuit-0.1.1/src/testsuit/cli/mxp.py +75 -0
  55. testsuit-0.1.1/src/testsuit/cli/notebooks.py +42 -0
  56. testsuit-0.1.1/src/testsuit/datatools/DataFileMgrs/AFileMgr.py +443 -0
  57. testsuit-0.1.1/src/testsuit/datatools/DataFileMgrs/CsvFileMgr.py +671 -0
  58. testsuit-0.1.1/src/testsuit/datatools/DataFileMgrs/DxdFileMgr.py +183 -0
  59. testsuit-0.1.1/src/testsuit/datatools/DataFileMgrs/FolderParamMgr.py +553 -0
  60. testsuit-0.1.1/src/testsuit/datatools/DataFileMgrs/H5FileMgr.py +644 -0
  61. testsuit-0.1.1/src/testsuit/datatools/DataFileMgrs/InfluxDbFileMgr.py +838 -0
  62. testsuit-0.1.1/src/testsuit/datatools/DataFileMgrs/MdfFileMgr.py +175 -0
  63. testsuit-0.1.1/src/testsuit/datatools/DataFileMgrs/TdmsFileMgr.py +177 -0
  64. testsuit-0.1.1/src/testsuit/datatools/DataFileMgrs/UdbfFileMgr.py +204 -0
  65. testsuit-0.1.1/src/testsuit/datatools/DataFileMgrs/__init__.py +0 -0
  66. testsuit-0.1.1/src/testsuit/datatools/DataFileMgrs/formats.py +262 -0
  67. testsuit-0.1.1/src/testsuit/datatools/DataframeToHdf5.py +139 -0
  68. testsuit-0.1.1/src/testsuit/datatools/__init__.py +1 -0
  69. testsuit-0.1.1/src/testsuit/datatools/data2db.py +977 -0
  70. testsuit-0.1.1/src/testsuit/datatools/datapack/ADataImporter.py +52 -0
  71. testsuit-0.1.1/src/testsuit/datatools/datapack/GitImporter.py +72 -0
  72. testsuit-0.1.1/src/testsuit/datatools/datapack/__init__.py +0 -0
  73. testsuit-0.1.1/src/testsuit/datatools/datapack/datapack_tools.py +565 -0
  74. testsuit-0.1.1/src/testsuit/datatools/datapack/evalfiles/evalfile.py +328 -0
  75. testsuit-0.1.1/src/testsuit/datatools/datapack/evalfiles/evalincludes.py +343 -0
  76. testsuit-0.1.1/src/testsuit/datatools/datapack/evalfiles/evalkeys.py +309 -0
  77. testsuit-0.1.1/src/testsuit/datatools/datapack/evalfiles/evalpath.py +373 -0
  78. testsuit-0.1.1/src/testsuit/datatools/datapack/evalfiles/libdictionary.py +255 -0
  79. testsuit-0.1.1/src/testsuit/datatools/datapack/importers.py +75 -0
  80. testsuit-0.1.1/src/testsuit/datatools/datapack/processors/basickeys.py +62 -0
  81. testsuit-0.1.1/src/testsuit/datatools/datapack/processors/filterkeys.py +33 -0
  82. testsuit-0.1.1/src/testsuit/datatools/datapack/processors/finalize.py +42 -0
  83. testsuit-0.1.1/src/testsuit/datatools/datapack/processors/replace.py +53 -0
  84. testsuit-0.1.1/src/testsuit/datatools/datatoolbox.py +496 -0
  85. testsuit-0.1.1/src/testsuit/datatools/h5diff.py +154 -0
  86. testsuit-0.1.1/src/testsuit/datatools/plotHelpers.py +973 -0
  87. testsuit-0.1.1/src/testsuit/exploit/mexploit/__init__.py +0 -0
  88. testsuit-0.1.1/src/testsuit/exploit/mexploit/conftest.py +461 -0
  89. testsuit-0.1.1/src/testsuit/exploit/mexploit/conftest_scn_template.py +25 -0
  90. testsuit-0.1.1/src/testsuit/exploit/mexploit/criteria.py +1202 -0
  91. testsuit-0.1.1/src/testsuit/exploit/mexploit/helpers.py +509 -0
  92. testsuit-0.1.1/src/testsuit/exploit/mexploit/mexploit.py +229 -0
  93. testsuit-0.1.1/src/testsuit/exploit/mexploit/registry.py +98 -0
  94. testsuit-0.1.1/src/testsuit/exploit/runner/__init__.py +0 -0
  95. testsuit-0.1.1/src/testsuit/exploit/runner/exploit_runner.py +483 -0
  96. testsuit-0.1.1/src/testsuit/exploit/runner/report.py +153 -0
  97. testsuit-0.1.1/src/testsuit/exploit/runner/report_html.py +1688 -0
  98. testsuit-0.1.1/src/testsuit/exploit/runner/runProcess.py +241 -0
  99. testsuit-0.1.1/src/testsuit/exploit/runner/utils.py +333 -0
  100. testsuit-0.1.1/src/testsuit/jupytertools/FileDialog.py +38 -0
  101. testsuit-0.1.1/src/testsuit/jupytertools/JupyterGui.py +404 -0
  102. testsuit-0.1.1/src/testsuit/jupytertools/MexploitJupyterGui.py +297 -0
  103. testsuit-0.1.1/src/testsuit/jupytertools/PlotJupyterGui.py +537 -0
  104. testsuit-0.1.1/src/testsuit/jupytertools/__init__.py +6 -0
  105. testsuit-0.1.1/src/testsuit/jupytertools/h5ConvertJupyterGui.py +235 -0
  106. testsuit-0.1.1/src/testsuit/jupytertools/install.py +56 -0
  107. testsuit-0.1.1/src/testsuit/jupytertools/notebooks/__init__.py +1 -0
  108. testsuit-0.1.1/src/testsuit/jupytertools/notebooks/data_plot.ipynb +28 -0
  109. testsuit-0.1.1/src/testsuit/jupytertools/notebooks/h5_convert.ipynb +28 -0
  110. testsuit-0.1.1/src/testsuit/jupytertools/notebooks/mexploit.ipynb +29 -0
  111. testsuit-0.1.1/src/testsuit/misc/MonitorProgress.py +457 -0
  112. testsuit-0.1.1/src/testsuit/misc/__init__.py +0 -0
  113. testsuit-0.1.1/src/testsuit/misc/files.py +99 -0
  114. testsuit-0.1.1/src/testsuit/misc/logger.py +120 -0
  115. testsuit-0.1.1/src/testsuit/plugins.py +77 -0
  116. testsuit-0.1.1/src/testsuit.egg-info/PKG-INFO +165 -0
  117. testsuit-0.1.1/src/testsuit.egg-info/SOURCES.txt +211 -0
  118. testsuit-0.1.1/src/testsuit.egg-info/dependency_links.txt +1 -0
  119. testsuit-0.1.1/src/testsuit.egg-info/entry_points.txt +11 -0
  120. testsuit-0.1.1/src/testsuit.egg-info/requires.txt +39 -0
  121. testsuit-0.1.1/src/testsuit.egg-info/top_level.txt +1 -0
  122. testsuit-0.1.1/tests/data2db_t.py +18 -0
  123. testsuit-0.1.1/tests/datapack_t.py +117 -0
  124. testsuit-0.1.1/tests/datatoolbox_t.py +76 -0
  125. testsuit-0.1.1/tests/etc/data/csv/CorridorParam.csv +7 -0
  126. testsuit-0.1.1/tests/etc/data/csv/National_Instruments.csv +170 -0
  127. testsuit-0.1.1/tests/etc/data/csv/channels_recording.csv +27 -0
  128. testsuit-0.1.1/tests/etc/data/csv/clocks.csv +5 -0
  129. testsuit-0.1.1/tests/etc/data/csv/demo_exploit.clean_01.csv +6 -0
  130. testsuit-0.1.1/tests/etc/data/csv/demo_exploit.clean_02.csv +6 -0
  131. testsuit-0.1.1/tests/etc/data/csv/flags.csv +4 -0
  132. testsuit-0.1.1/tests/etc/data/csv/influxdb.csv +27 -0
  133. testsuit-0.1.1/tests/etc/data/csv/test_date_at_the_end.csv +6 -0
  134. testsuit-0.1.1/tests/etc/datapack/setup/globals.dico +2 -0
  135. testsuit-0.1.1/tests/etc/datapack/setup/sample_conf_git.yml +73 -0
  136. testsuit-0.1.1/tests/etc/datapack/setup/sample_ref_files/ref1.txt +2 -0
  137. testsuit-0.1.1/tests/etc/datapack/setup/sample_ref_files/ref2.txt +4 -0
  138. testsuit-0.1.1/tests/etc/datapack/setup/utest_conf_dtpk.yml +35 -0
  139. testsuit-0.1.1/tests/etc/datapack/setup/utest_ref_files/ref1.txt +2 -0
  140. testsuit-0.1.1/tests/etc/datapack/setup/utest_ref_files/ref2.txt +4 -0
  141. testsuit-0.1.1/tests/etc/datapack/testdef/baseline.dico +4 -0
  142. testsuit-0.1.1/tests/etc/datapack/testdef/datapack_utest.yml +10 -0
  143. testsuit-0.1.1/tests/etc/datapack/testdef/local_ref_files/my_ref_file.txt +2 -0
  144. testsuit-0.1.1/tests/etc/datapack/testdef/utest_values.dico +7 -0
  145. testsuit-0.1.1/tests/etc/datapack/testdef/values.dico +5 -0
  146. testsuit-0.1.1/tests/etc/exploit_runner/exploit_config_NOK.yml +19 -0
  147. testsuit-0.1.1/tests/etc/exploit_runner/exploit_config_NOK_comments.yml +24 -0
  148. testsuit-0.1.1/tests/etc/exploit_runner/exploit_config_OK.yml +14 -0
  149. testsuit-0.1.1/tests/etc/exploit_runner/exploit_config_OK_comments.yml +18 -0
  150. testsuit-0.1.1/tests/etc/exploit_runner/exploit_shiftDateConst_OK.yml +24 -0
  151. testsuit-0.1.1/tests/etc/exploit_runner/exploit_shiftDateParam_OK.yml +28 -0
  152. testsuit-0.1.1/tests/etc/exploit_runner/scenario/compute_clock_drift/clock_drift.mexploit.yml +13 -0
  153. testsuit-0.1.1/tests/etc/exploit_runner/scenario/session_NOK/testrun_01/testsuite01.mexploit.yaml +18 -0
  154. testsuit-0.1.1/tests/etc/exploit_runner/scenario/session_NOK/testrun_02/testsuite_02.mexploit.yaml +21 -0
  155. testsuit-0.1.1/tests/etc/exploit_runner/scenario/session_OK/testrun_01/testsuite01.mexploit.yml +30 -0
  156. testsuit-0.1.1/tests/etc/exploit_runner/scenario/session_OK/testrun_01/testsuite02.mexploit.yml +34 -0
  157. testsuit-0.1.1/tests/etc/exploit_runner/scenario/session_OK/testrun_01/testsuite03.mexploit.yaml +50 -0
  158. testsuit-0.1.1/tests/etc/exploit_runner/scenario/session_OK/testrun_01/testsuite04.mexploit.yaml +70 -0
  159. testsuit-0.1.1/tests/etc/exploit_runner/scenario/session_OK/testrun_02/testsuite01.mexploit.yml +30 -0
  160. testsuit-0.1.1/tests/etc/exploit_runner/scenario/session_OK/testrun_02/testsuite02.mexploit.yml +36 -0
  161. testsuit-0.1.1/tests/etc/exploit_runner/scenario/session_OK/testrun_02/testsuite03.mexploit.yaml +59 -0
  162. testsuit-0.1.1/tests/etc/exploit_runner/scenario/shiftDateConst_OK/param1_partially_shifted.mexploit.yml +37 -0
  163. testsuit-0.1.1/tests/etc/exploit_runner/scenario/shiftDateConst_OK/param2_not_shifted.mexploit.yml +37 -0
  164. testsuit-0.1.1/tests/etc/exploit_runner/scenario/shiftDateParam_OK/param1_partially_shifted.mexploit.yml +38 -0
  165. testsuit-0.1.1/tests/etc/exploit_runner/scenario/shiftDateParam_OK/param2_not_shifted.mexploit.yml +37 -0
  166. testsuit-0.1.1/tests/etc/exploit_runner/values.dico +1 -0
  167. testsuit-0.1.1/tests/etc/mexploit/custom_exploit/custom_criteria.py +45 -0
  168. testsuit-0.1.1/tests/etc/mexploit/custom_exploit/custom_helpers.py +17 -0
  169. testsuit-0.1.1/tests/etc/mexploit/scenarii/mxp_NOK_check_param_at_rst/1_check_param_at_rest.mexploit.yaml +19 -0
  170. testsuit-0.1.1/tests/etc/mexploit/scenarii/mxp_NOK_corridor/0_corridor.mexploit.yaml +18 -0
  171. testsuit-0.1.1/tests/etc/mexploit/scenarii/mxp_NOK_sequence/0_sequence.mexploit.yaml +21 -0
  172. testsuit-0.1.1/tests/etc/mexploit/scenarii/mxp_NOK_sequence_multi/0_sequence.mexploit.yaml +36 -0
  173. testsuit-0.1.1/tests/etc/mexploit/scenarii/mxp_OK_custom_crit/1_custom.mexploit.yaml +12 -0
  174. testsuit-0.1.1/tests/etc/mexploit/scenarii/mxp_OK_main_functions/0_time_origin.mexploit.yml +30 -0
  175. testsuit-0.1.1/tests/etc/mexploit/scenarii/mxp_OK_main_functions/1_computed_param.mexploit.yml +35 -0
  176. testsuit-0.1.1/tests/etc/mexploit/scenarii/mxp_OK_main_functions/1_computed_param_multiline.mexploit.yml +14 -0
  177. testsuit-0.1.1/tests/etc/mexploit/scenarii/mxp_OK_main_functions/1_corridor.mexploit.yaml +63 -0
  178. testsuit-0.1.1/tests/etc/mexploit/scenarii/mxp_OK_main_functions/1_sequence.mexploit.yaml +85 -0
  179. testsuit-0.1.1/tests/etc/mexploit/scenarii/mxp_OK_main_functions/2_plot.mexploit.yaml +82 -0
  180. testsuit-0.1.1/tests/etc/mexploit/scenarii/mxp_OK_main_functions/3_helper_dropdups.mexploit.yml +2 -0
  181. testsuit-0.1.1/tests/etc/mexploit/scenarii/mxp_OK_main_functions/3_helper_mask_values_on_event.mexploit.yml +1 -0
  182. testsuit-0.1.1/tests/etc/mexploit/scenarii/mxp_OK_registered_crit/1_registered.mexploit.yaml +7 -0
  183. testsuit-0.1.1/tests/etc/misc/flags_desc.yml +15 -0
  184. testsuit-0.1.1/tests/evalincludes_t.py +14 -0
  185. testsuit-0.1.1/tests/exploit_runner_t.py +73 -0
  186. testsuit-0.1.1/tests/extensions_t.py +306 -0
  187. testsuit-0.1.1/tests/h5filemgr_t.py +31 -0
  188. testsuit-0.1.1/tests/loaddata_t.py +84 -0
  189. testsuit-0.1.1/tests/mexploit_t.py +59 -0
  190. testsuit-0.1.1/tests/misc_t.py +134 -0
  191. testsuit-0.1.1/tests/notebooks_t.py +37 -0
  192. testsuit-0.1.1/tests/ref/datapack_test/datapack_utest/.processing/.datapack_utest.yml.html +19 -0
  193. testsuit-0.1.1/tests/ref/datapack_test/datapack_utest/.processing/.datapack_utest.yml.keys +0 -0
  194. testsuit-0.1.1/tests/ref/datapack_test/datapack_utest/.processing/.globals.dico.html +3 -0
  195. testsuit-0.1.1/tests/ref/datapack_test/datapack_utest/.processing/.globals.dico.keys +0 -0
  196. testsuit-0.1.1/tests/ref/datapack_test/datapack_utest/.processing/.utest_conf_dtpk.yml.html +69 -0
  197. testsuit-0.1.1/tests/ref/datapack_test/datapack_utest/.processing/.utest_conf_dtpk.yml.keys +0 -0
  198. testsuit-0.1.1/tests/ref/datapack_test/datapack_utest/.processing/datapack_utest.yml +10 -0
  199. testsuit-0.1.1/tests/ref/datapack_test/datapack_utest/.processing/globals.dico +2 -0
  200. testsuit-0.1.1/tests/ref/datapack_test/datapack_utest/.processing/testdef.dico +12 -0
  201. testsuit-0.1.1/tests/ref/datapack_test/datapack_utest/.processing/utest_conf_dtpk.yml +35 -0
  202. testsuit-0.1.1/tests/ref/datapack_test/datapack_utest/context.log +21 -0
  203. testsuit-0.1.1/tests/ref/datapack_test/datapack_utest/mycmp1/input/.MyRef1.txt.html +2 -0
  204. testsuit-0.1.1/tests/ref/datapack_test/datapack_utest/mycmp1/input/.MyRef1.txt.keys +2 -0
  205. testsuit-0.1.1/tests/ref/datapack_test/datapack_utest/mycmp1/input/MyRef1.txt +2 -0
  206. testsuit-0.1.1/tests/ref/datapack_test/datapack_utest/mycmp1/input/MyRef2.txt +4 -0
  207. testsuit-0.1.1/tests/ref/loaddata_test/National_Instruments.h5 +0 -0
  208. testsuit-0.1.1/tests/ref/loaddata_test/channels_recording.h5 +0 -0
  209. testsuit-0.1.1/tests/ref/loaddata_test/flags_flags.h5 +0 -0
  210. testsuit-0.1.1/tests/ref/loaddata_test/influxdb.h5 +0 -0
  211. testsuit-0.1.1/tests/ref/loaddata_test/sample_csv.h5 +0 -0
  212. testsuit-0.1.1/tests/ref/loaddata_test/sample_csv_date_at_the_end.h5 +0 -0
  213. testsuit-0.1.1/tests/tdms_t.py +43 -0
@@ -0,0 +1,19 @@
1
+ # https://editorconfig.org
2
+ root = true
3
+
4
+ [*]
5
+ charset = utf-8
6
+ insert_final_newline = true
7
+ trim_trailing_whitespace = true
8
+
9
+ [*.py]
10
+ indent_style = space
11
+ indent_size = 4
12
+
13
+ [*.{yml,yaml,json,toml}]
14
+ indent_style = space
15
+ indent_size = 2
16
+
17
+ # pyproject.toml and README.md are stored with Windows line endings
18
+ [{pyproject.toml,README.md}]
19
+ end_of_line = crlf
@@ -0,0 +1,58 @@
1
+ name: publish
2
+
3
+ on:
4
+ push:
5
+ tags: ["v*"]
6
+
7
+ permissions:
8
+ contents: read
9
+ id-token: write # required for PyPI trusted publishing (OIDC)
10
+
11
+ jobs:
12
+ build:
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - uses: actions/checkout@v4
16
+
17
+ - uses: actions/setup-python@v5
18
+ with:
19
+ python-version: "3.12"
20
+
21
+ - name: Install build
22
+ run: python -m pip install --upgrade build
23
+
24
+ - name: Build sdist and wheel
25
+ run: python -m build
26
+
27
+ - name: Upload dist to job artifacts
28
+ uses: actions/upload-artifact@v4
29
+ with:
30
+ name: dist
31
+ path: dist/
32
+
33
+ publish-pypi:
34
+ needs: build
35
+ runs-on: ubuntu-latest
36
+ permissions:
37
+ id-token: write
38
+ steps:
39
+ - name: Download dist
40
+ uses: actions/download-artifact@v4
41
+ with:
42
+ name: dist
43
+ path: dist/
44
+
45
+ - name: Get PyPI token
46
+ id: get_pypi_token
47
+ run: |
48
+ response=$(curl -sf -H "Authorization: Bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "${ACTIONS_ID_TOKEN_REQUEST_URL}&audience=pypi")
49
+ echo "id_token=$(echo "$response" | jq -r .value)" >> "$GITHUB_OUTPUT"
50
+
51
+ - name: Publish to PyPI
52
+ env:
53
+ TWINE_NON_INTERACTIVE: 1
54
+ TWINE_USERNAME: __token__
55
+ TWINE_PASSWORD: ${{ steps.get_pypi_token.outputs.id_token }}
56
+ run: |
57
+ python -m pip install twine
58
+ python -m twine upload --repository pypi dist/*
@@ -0,0 +1,72 @@
1
+ name: tests
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ jobs:
9
+ lint:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+ - uses: actions/setup-python@v5
14
+ with:
15
+ python-version: "3.12"
16
+ - name: Ruff (runtime errors and bug-prone patterns, see [tool.ruff] in pyproject.toml)
17
+ run: |
18
+ python -m pip install ruff
19
+ ruff check .
20
+
21
+ pytest:
22
+ runs-on: ubuntu-latest
23
+ strategy:
24
+ fail-fast: false
25
+ matrix:
26
+ python-version: ["3.10", "3.12"]
27
+ steps:
28
+ - uses: actions/checkout@v4
29
+ with:
30
+ fetch-depth: 0 # setuptools-scm needs history/tags for the version
31
+ - uses: actions/setup-python@v5
32
+ with:
33
+ python-version: ${{ matrix.python-version }}
34
+ - name: Install
35
+ run: |
36
+ python -m pip install --upgrade pip
37
+ python -m pip install -e ".[test]"
38
+ - name: Run tests
39
+ run: python -m pytest -q
40
+
41
+ example:
42
+ # examples/acme_testbench: a separate package extending testsuit through its plugin entry point
43
+ runs-on: ubuntu-latest
44
+ steps:
45
+ - uses: actions/checkout@v4
46
+ with:
47
+ fetch-depth: 0
48
+ - uses: actions/setup-python@v5
49
+ with:
50
+ python-version: "3.12"
51
+ - name: Install testsuit and the example
52
+ run: |
53
+ python -m pip install --upgrade pip
54
+ python -m pip install -e .
55
+ python -m pip install -e "examples/acme_testbench[test]"
56
+ - name: Run the example's tests
57
+ working-directory: examples/acme_testbench
58
+ run: python -m pytest -q
59
+
60
+ build:
61
+ runs-on: ubuntu-latest
62
+ steps:
63
+ - uses: actions/checkout@v4
64
+ with:
65
+ fetch-depth: 0
66
+ - uses: actions/setup-python@v5
67
+ with:
68
+ python-version: "3.12"
69
+ - name: Build sdist and wheel
70
+ run: |
71
+ python -m pip install build
72
+ python -m build
@@ -0,0 +1,19 @@
1
+ __pycache__
2
+ .ipynb_checkpoints
3
+ *.pyc
4
+ *.ipynb
5
+ # starter notebooks shipped with the package (testsuit-notebooks command)
6
+ !src/testsuit/jupytertools/notebooks/*.ipynb
7
+ demo_data
8
+ *.tmp
9
+ tmp/
10
+ .current_datapack
11
+ # for testing datapack import
12
+ dataset.dico
13
+ .dataset.dico
14
+ tests/etc/mexploit/scenarii/*/conftest.py
15
+ .venv
16
+ .current_datapack
17
+ *.egg-info/
18
+ build/
19
+ dist/
@@ -0,0 +1,118 @@
1
+ # Contributing
2
+
3
+ ## Setup
4
+
5
+ ```bash
6
+ python -m venv .venv && source .venv/bin/activate
7
+ pip install -e ".[dev]"
8
+ pytest
9
+ ruff check .
10
+ ```
11
+
12
+ Both commands must pass before a pull request is merged; CI runs them on Python 3.10 and 3.12 and also builds the package.
13
+
14
+ ## Conventions
15
+
16
+ - All code lives in the `testsuit` package under `src/testsuit/` and is imported as `testsuit.datatools...`, `testsuit.misc...`, never through `sys.path` edits.
17
+ - Command-line tools live in `src/testsuit/cli/`. Keep the logic in an importable function (for example `data2h5()` in `cli/data2h5.py`) and put argument parsing in `main()`, so tests can call the function directly.
18
+ - Tests are `tests/<topic>_t.py`. Their inputs go in `tests/etc/`, the expected outputs they compare against go in `tests/ref/`, and anything they write goes under `tests/tmp/` (ignored by git).
19
+ - New runtime dependencies go in `[project].dependencies` of `pyproject.toml`; dependencies only needed by one feature go in an extra under `[project.optional-dependencies]`.
20
+ - Versions come from git tags (setuptools-scm): tag a release as `vX.Y.Z` on `main`.
21
+
22
+ ## Adding a data file format
23
+
24
+ 1. Create `src/testsuit/datatools/DataFileMgrs/<Format>FileMgr.py` with a class deriving from `AFileMgr` (see `CsvFileMgr.py` or `MdfFileMgr.py` for complete examples).
25
+ 2. Register it at the end of `src/testsuit/datatools/DataFileMgrs/formats.py` with `register_file_format(..., builtin=True)`, using a factory that imports your module, so its dependencies are only needed when such a file is loaded. This also adds its extensions to `SUPPORTED_DATAFILE_EXTENSIONS`.
26
+ A new CSV syntax is a `CsvFileMgr` subclass registered with `register_csv_variant(..., builtin=True)` instead.
27
+ 3. Add a sample file under `tests/etc/data/` and a case in `tests/loaddata_t.py`.
28
+
29
+ ## Adding a command-line tool
30
+
31
+ 1. Add `src/testsuit/cli/<name>.py` with a `main()` that parses arguments and calls an importable function.
32
+ 2. Register it under `[project.scripts]` in `pyproject.toml` as `<name> = "testsuit.cli.<name>:main"`.
33
+ 3. Re-run `pip install -e .` so the command is created, and list it in the README.
34
+
35
+ ## Adding a mexploit check
36
+
37
+ A scenario entry `type: foo` runs the criterion `foo`, a function `crit_foo(critConf, ...)`. It is looked up in the scenario's own libraries first, then in the criteria registered by external code, then in the default ones.
38
+
39
+ - For a check everyone can use, add `crit_foo` to `src/testsuit/exploit/mexploit/criteria.py` and cover it with a scenario under `tests/etc/mexploit/scenarii/mxp_OK_main_functions/`.
40
+ - For a project-specific check, keep it outside this repo: either register it from your library (see below), or write `crit_foo` in your own module and load it from the scenario with a `# MXP_REGISTER_CRITLIB(path/to/your_criteria.py)` line, as in `tests/etc/mexploit/scenarii/mxp_OK_custom_crit/`.
41
+
42
+ ## Extending testsuit from another library
43
+
44
+ An application built on testsuit can add formats, criteria, datapack importers and its own report logo without changing this repo. The extension points are tested in `tests/extensions_t.py`. `examples/acme_testbench` is a complete example project using all of them, with its own tests run by CI.
45
+
46
+ ### Data file formats
47
+
48
+ ```python
49
+ from testsuit.datatools.DataFileMgrs.formats import register_file_format, register_csv_variant
50
+ from testsuit.datatools.DataFileMgrs.CsvFileMgr import CsvFileMgr
51
+
52
+ # a brand new format: extensions and a factory(filename, fileIdx), usually an AFileMgr subclass
53
+ register_file_format("myformat", ["myf"], MyFormatFileMgr)
54
+
55
+ # a known reader for another extension
56
+ register_file_format("mylogs", ["mlog"], CsvFileMgr)
57
+
58
+ # a CSV syntax, detected from the file (here its first line), read by a CsvFileMgr subclass
59
+ register_csv_variant("mylogger",
60
+ lambda filename: open(filename).readline().startswith("#MYLOGGER"),
61
+ MyLoggerCsvFileMgr)
62
+ ```
63
+
64
+ Registered formats are tried before the built-in ones, so they can also take over a built-in extension; `accepts=lambda filename: ...` limits a format to some of the files with its extensions. `FolderParamMgr`, `loadDataframeFromFile()` and the command-line tools then load these files like the built-in ones.
65
+
66
+ ### mexploit criteria
67
+
68
+ ```python
69
+ from testsuit.exploit.mexploit.registry import register_criterion, register_criteria_module
70
+
71
+ @register_criterion # scenario entries 'type: my_check'
72
+ def crit_my_check(critConf):
73
+ assert critConf["value"] < critConf["maxValue"], "value too high"
74
+
75
+ register_criteria_module("mylib.mexploit_criteria") # every crit_* function of that module
76
+ ```
77
+
78
+ Criteria can use the mexploit fixtures and helpers exactly like the ones in `criteria.py`.
79
+
80
+ ### HTML report logo
81
+
82
+ The exploit_runner report starts with an animated "M-Exploit" logo (`report_html.make_report_logo_svg()`). To use your own:
83
+
84
+ ```python
85
+ exploit_runner(conf_file, report_logo_title="ACME Bench") # same animated logo, your title
86
+ exploit_runner(conf_file, report_logo_svg="path/to/logo.svg") # your SVG (file or markup), "" for none
87
+
88
+ from testsuit.exploit.runner.report_html import set_default_report_logo
89
+ set_default_report_logo(svg="path/to/logo.svg") # or title="ACME Bench": every report of the process
90
+ ```
91
+
92
+ From the command line: `exploit_runner --report-logo logo.svg` or `--report-logo-title "ACME Bench"`.
93
+
94
+ ### datapack importers
95
+
96
+ ```python
97
+ from testsuit.datatools.datapack.importers import register_data_importer
98
+
99
+ # datasource 'importer: myserver' in datapack setup files; any factory(targetDir, remotePath, versionId)
100
+ register_data_importer("myserver", MyServerImporter) # an ADataImporter subclass
101
+ ```
102
+
103
+ `remotePath` is the datasource `path`, `versionId` the dataset `path`. After `retrieve()`, the dataset folder must contain a `dataset.dico` file, whose keys the datapack files can use. `git` is the built-in importer.
104
+
105
+ ### Making registrations visible to the command-line tools
106
+
107
+ The calls above are enough when your code runs testsuit in its own process (`mexploit()`, `exploit_runner()`, `FolderParamMgr`). The command-line tools, and the `mxp` processes that exploit_runner starts for each test run, only see them when they come from a plugin, loaded by `testsuit.plugins.load_plugins()`:
108
+
109
+ - declare an entry point in your package; its target is called without argument:
110
+
111
+ ```toml
112
+ [project.entry-points."testsuit.plugins"]
113
+ mylib = "mylib.testsuit_plugin:register"
114
+ ```
115
+
116
+ - or list modules in the `TESTSUIT_PLUGINS` environment variable (`module` or `module:function`, comma-separated; a module given alone has its `register()` called if it defines one). Child processes inherit it.
117
+
118
+ A plugin that fails to load is logged as a warning and skipped.
testsuit-0.1.1/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,165 @@
1
+ Metadata-Version: 2.4
2
+ Name: testsuit
3
+ Version: 0.1.1
4
+ Summary: Toolbox for preparing and analysing tests data
5
+ Author: Laurent Millet-Lacombe
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/laurentmldev/testsuit
8
+ Project-URL: Source, https://github.com/laurentmldev/testsuit
9
+ Project-URL: Issues, https://github.com/laurentmldev/testsuit/issues
10
+ Keywords: test data,hdf5,tdms,mdf,csv,data analysis,test campaign
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3.10
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Topic :: Scientific/Engineering
16
+ Requires-Python: >=3.10
17
+ Description-Content-Type: text/markdown
18
+ License-File: LICENSE
19
+ Requires-Dist: numpy>=2.2.6
20
+ Requires-Dist: pandas>=2.3.3
21
+ Requires-Dist: requests>=2.32.5
22
+ Requires-Dist: GitPython>=3.1
23
+ Requires-Dist: colorama>=0.4
24
+ Requires-Dist: h5py>=3.15
25
+ Requires-Dist: Unidecode>=1.4
26
+ Requires-Dist: pytest-html>=4.1
27
+ Requires-Dist: pytest-metadata>=3.1
28
+ Requires-Dist: matplotlib>=3.10
29
+ Requires-Dist: asammdf>=8.7
30
+ Requires-Dist: pytest>=8
31
+ Requires-Dist: PyYAML>=6.0
32
+ Requires-Dist: ruamel.yaml>=0.18
33
+ Requires-Dist: Markdown>=3.5
34
+ Requires-Dist: python-dateutil>=2.8
35
+ Requires-Dist: npTDMS>=1.10
36
+ Requires-Dist: dwdatareader>=1.3
37
+ Provides-Extra: plotly
38
+ Requires-Dist: plotly>=5; extra == "plotly"
39
+ Provides-Extra: jupyter
40
+ Requires-Dist: ipython>=8; extra == "jupyter"
41
+ Requires-Dist: ipywidgets>=8; extra == "jupyter"
42
+ Requires-Dist: nbclassic>=1.0; extra == "jupyter"
43
+ Provides-Extra: influxdb
44
+ Requires-Dist: influxdb-client>=1.40; extra == "influxdb"
45
+ Requires-Dist: influxdb3-python>=0.10; extra == "influxdb"
46
+ Requires-Dist: pyarrow>=15; extra == "influxdb"
47
+ Provides-Extra: test
48
+ Requires-Dist: plotly>=5; extra == "test"
49
+ Provides-Extra: dev
50
+ Requires-Dist: testsuit[test]; extra == "dev"
51
+ Requires-Dist: build>=1.3; extra == "dev"
52
+ Requires-Dist: ruff>=0.6; extra == "dev"
53
+ Dynamic: license-file
54
+
55
+ # testsuit
56
+
57
+ Toolbox for preparing and analysing test data: load measurement files (CSV, TDMS, MDF, Dewesoft DXD, UDBF, HDF5, InfluxDB) into pandas, convert them to HDF5 or push them to a database, check results against YAML scenarios, and package test inputs into datapacks.
58
+
59
+ ## Installation
60
+
61
+ Python 3.10 or newer is required.
62
+
63
+ ```bash
64
+ git clone https://github.com/laurentmldev/testsuit.git
65
+ cd testsuit
66
+ python -m venv .venv && source .venv/bin/activate # Windows: .venv\Scripts\activate
67
+ pip install -e .
68
+ ```
69
+
70
+ Optional features are installed as extras:
71
+
72
+ | Extra | Adds |
73
+ |------------|----------------------------------------------|
74
+ | `plotly` | interactive plots in mexploit reports |
75
+ | `jupyter` | notebook GUIs (`jupytertools`) |
76
+ | `influxdb` | InfluxDB readers and `data2db` targets |
77
+ | `test` | what the test suite needs |
78
+ | `dev` | `test` plus build and lint tools |
79
+
80
+ For example `pip install -e ".[plotly,jupyter]"`.
81
+
82
+ To use testsuit without cloning it, install straight from GitHub (add `@<tag>` to pin a version):
83
+
84
+ ```bash
85
+ pip install "testsuit[jupyter] @ git+https://github.com/laurentmldev/testsuit.git"
86
+ ```
87
+
88
+ ## Jupyter GUIs
89
+
90
+ Three notebook GUIs come with the package: Data-Plot (browse and plot parameters), H5-Conv (convert data files to HDF5) and M-Exploit (run a scenario and view its report). Copy their starter notebooks into a working folder and open Jupyter there:
91
+
92
+ ```bash
93
+ pip install "testsuit[jupyter]" # or: pip install -e ".[jupyter]" from a clone
94
+ testsuit-notebooks ~/my_analysis --open # copies data_plot, h5_convert and mexploit .ipynb
95
+ ```
96
+
97
+ The notebooks only call `runGUI()` from the installed package, so upgrading testsuit upgrades the GUIs without copying the notebooks again (`--force` refreshes them). The GUIs need the classic notebook UI (`jupyter nbclassic`, what `--open` starts), and a desktop session for their file dialogs (tkinter).
98
+
99
+ ## Repository layout
100
+
101
+ ```
102
+ src/testsuit/ the installable package
103
+ datatools/ load data files into pandas, convert to HDF5, push to a DB
104
+ DataFileMgrs/ one reader per file format (Csv, Tdms, Mdf, Dxd, Udbf, H5, InfluxDb)
105
+ datapack/ datapack generation: dictionaries, includes, key replacement
106
+ exploit/
107
+ mexploit/ YAML scenario checks (corridors, sequences, computed params, plots) run through pytest
108
+ runner/ runs mexploit over test sessions and builds HTML reports
109
+ jupytertools/ ipywidgets GUIs for notebooks
110
+ misc/ logging, progress reporting, file helpers
111
+ cli/ command-line tools (see below)
112
+ examples/ sample configuration files, and acme_testbench: a library extending testsuit
113
+ tests/ pytest suite (*_t.py)
114
+ etc/ input data, scenarios and configs used by the tests
115
+ ref/ reference outputs the tests compare against
116
+ ```
117
+
118
+ ## Command-line tools
119
+
120
+ Installing the package puts these commands on your `PATH`. Each prints its full usage with `--help`, for example `data2h5 --help`. They can also be run as `python -m testsuit.cli.<name>`.
121
+
122
+ | Command | Purpose |
123
+ |--------------------------|-------------------------------------------------------------------|
124
+ | `data2h5` | extract parameters from data files or folders into an HDF5 file |
125
+ | `data2db` | push parameters from data files into a database (InfluxDB, ClickHouse) |
126
+ | `extract_data_any` | decode raw bit fields into parameters from a JSON/YAML config (example: `examples/config_extract_data_any.json`) |
127
+ | `extract_data_flags` | extract flag values described in a YAML file |
128
+ | `apply_clock_correction` | shift timestamps of a folder of data files |
129
+ | `mxp` | run a mexploit scenario folder against data folders |
130
+ | `exploit_runner` | run mexploit over whole test sessions from a YAML config |
131
+ | `datapack` | generate a datapack from a test definition file |
132
+ | `evalfile` | resolve includes and keys in a file from dictionaries |
133
+ | `testsuit-notebooks` | copy the Jupyter GUI notebooks into a folder, optionally open Jupyter |
134
+
135
+ ## Using the library
136
+
137
+ ```python
138
+ from testsuit.datatools.datatoolbox import loadDataframeFromFile
139
+ from testsuit.exploit.mexploit.mexploit import mexploit
140
+
141
+ # run the checks of a scenario folder on a data folder, results written to out/
142
+ dfs = loadDataframeFromFile("tests/etc/data/csv/flags.csv", ".*") # one DataFrame per parameter
143
+
144
+ rc = mexploit("tests/etc/mexploit/scenarii/mxp_OK_main_functions", "tests/etc/data", "out/", force=True)
145
+ ```
146
+
147
+ The scenarios under `tests/etc/mexploit/scenarii/` are working examples of every check type.
148
+
149
+ ## Running the tests
150
+
151
+ ```bash
152
+ pip install -e ".[dev]"
153
+ pytest # runs tests/*_t.py
154
+ ruff check . # catches runtime errors such as undefined names
155
+ ```
156
+
157
+ CI (`.github/workflows/tests.yml`) runs the same lint, the tests on Python 3.10 and 3.12, and a package build, on every pull request.
158
+
159
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for how to add a file format, a mexploit check or a script, and how another library can register its own formats, criteria and report logo.
160
+
161
+ ## License
162
+
163
+ Apache License 2.0, see [LICENSE](LICENSE).
164
+
165
+ THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR ITS COMPANY BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.