proud-dentist-22844
01/28/2023, 5:31 PMtarget()
with dependencies on the subdirs. That should ensure the glob is satisfied for the tests.
Here is the directory and the target()
I’m adding for it:
https://github.com/StackStorm/st2/tree/master/st2tests/st2tests/fixtures/packs
https://github.com/StackStorm/st2/pull/5874/files#diff-0a765a0e1409bcce280bee085bd5903e219b4c63a442696f8d23216a525d882a
But, I am afraid (and I’ve got feedback from others who are afraid) of not keeping the target()
dependencies up-to-date as people add new directories. Can I use globs in dependencies
to avoid that? And if yes, can I use !
to ignore a couple of directories so they are not direct dependencies (but transitive is fine)?enough-analyst-54434
01/28/2023, 5:39 PMproud-dentist-22844
01/28/2023, 5:40 PMenough-analyst-54434
01/28/2023, 5:40 PMimport *
enough-analyst-54434
01/28/2023, 5:41 PMpacks
use *`**/packs/**` from a BUILD in repo root*proud-dentist-22844
01/28/2023, 5:49 PM__init__.py
and a fixture.py
with a constant. That python target then depends on the resources targets that are contained in the fixture. This way dependency inference brings in all the fixtures required for a test because the test imports the constant from that fixture. But, the last few tests use a glob to include a lot of the fixtures. So, I need a target that includes all of them even though it is reminiscent of import *
.
Using a higher level target that includes globs in sources would cause problems because then multiple targets would own the files, and for most tests, they only need a couple of them, so I don't want to include all of them.proud-dentist-22844
01/28/2023, 5:55 PMsubdir_glob()
target in a plugin to do what I want. 🤔proud-dentist-22844
01/30/2023, 7:32 PMpacks_glob()
dep inference is implemented here:
https://github.com/StackStorm/st2/pull/5874/files#diff-85923e3f477f36c3b348f492d5f0dc3daea954a2d35001c8c7b38485789d8aafR43-R76