Skip to content

(hooks): check if most xml dependencies are met

Kevin GAUDET requested to merge check_xml_dependencies into dev

What does this MR do?

  • Adds a new hook verifying if all objects and services in a configuration have their bundle included in the Properties.cmake.
  • Checks if all requirement tags are in the Properties.cmake as well.
  • Enables the new hook by default for sheldon.

How to test it?

  • Run the unit test: cd hooks && python3 -m unittest tests\test_check_xml_dependencies.py.
  • Modify a XML file in a sight repo and run sheldon.

Some results

Test output log:

$ python -m unittest tests/test_check_xml_dependencies.py
...
λ python -m unittest tests\test_check_xml_dependencies.py
* [Sheldon] Checking C:\Users\kgaudet\Dev\sight\tools\sight-git\hooks\tests/data/dependency_test_repo/Bundles/missing_deps/rc/missing_deps.xml dependencies...
*** [ERROR] Dependency missing in C:\Users\kgaudet\Dev\sight\tools\sight-git\hooks\tests/data/dependency_test_repo/Bundles/missing_deps/rc/missing_deps.xml :
- configuration requires 'servicesReg' but it is missing in the 'Properties.cmake'
- an object or service from 'uiIO' is used but the bundle is missing from the 'Properties.cmake' requirements.
- an object or service from 'totoReg' is used but the bundle is missing from the 'Properties.cmake' requirements.

 ***
.* [Sheldon] Checking C:\Users\kgaudet\Dev\sight\tools\sight-git\hooks\tests/data/dependency_test_repo/Bundles/valid_deps/rc/valid_deps.xml dependencies...
.* [Sheldon] Checking C:\Users\kgaudet\Dev\sight\tools\sight-git\hooks\tests/data/dependency_test_repo/Bundles/missing_properties/rc/missing_properties.xml dependencies...
*** [ERROR] Dependency missing in C:\Users\kgaudet\Dev\sight\tools\sight-git\hooks\tests/data/dependency_test_repo/Bundles/missing_properties/rc/missing_properties.xml :
- configuration does not seem to be part of a bundle.

 ***
.
----------------------------------------------------------------------
Ran 3 tests in 0.152s

OK

Associated Issues/Merge Requests

Closes #8 (closed).

Edited by Kevin GAUDET

Merge request reports