I have some tests that use globs to access other d...
# general
I have some tests that use globs to access other directories of files, so I’m adding a dependency from the tests to a new
with dependencies on the subdirs. That should ensure the glob is satisfied for the tests. Here is the directory and the
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
dependencies up-to-date as people add new directories. Can I use globs in
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)?
Can you not use a naming convention and a high (in the filesystem) target to ensure stability?
I’m not sure I understand. How would a naming convention help here?
Dependency globs have not been permitted historically because it is
import *
👍 1
If all dirs containing files are named
use *`**/packs/**` from a BUILD in repo root*
Hmm. In each of these subdirectories, I added an
and a
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.
I'm wondering if I'm going to have to invent a
target in a plugin to do what I want. 🤔
So, I created a new glob target to handle this.
dep inference is implemented here: https://github.com/StackStorm/st2/pull/5874/files#diff-85923e3f477f36c3b348f492d5f0dc3daea954a2d35001c8c7b38485789d8aafR43-R76