Did you try the COLCON_IGNORE approach? Also I think you can use --package-ignore as well instead of skip. It’s a different behavior as anything not discovered by colcon as a package in your workspace will be assumed to be a system dependency and is presumed to be already on your system. It seems that if you ignore any of these packages that you don’t want to install/compile it will get you where you want to go pretty quickly.
colcon historically hasn’t known or cared about the type of a dependency. That has been specifically encoded extra information to facilitate packaging and releasing whereas colcon was focused on being a way to develop in a workspace. And it definitely doesn’t
Most of the packaging and release management tools don’t use colcon or a workspace. For example colcon is never used during the debian build pipeline created by bloom, it’s always standard cmake... make ... make install or setup.py ... if it’s python. And every package is specifically checked out into an isolated container and then with only it’s declared dependencies built in isolation. But for a workspace build we don’t apply this level of rigor.
We could certainly add a filter to exclude specific dependency types where test_depend would be the one that you want to skip. I wouldn’t directly couple it to being in Release mode. As assuming you’ll never run tests in Release mode is not guaranteed. By default in a dev environment testing the Release build is valuable.
Depending on where you’re going this may be something you want to double check that this isn’t turning into an X-Y problem. With the choice to not use rosdep and develop using a different approach you’re already explicitly stepping off of the beaten path.
On this front have you considered defining your own rosdep sources list to refine the keys and keep using the standard tools with your own source of authority.
And if you find any overly broad dependencies or missing dependencies I’m sure the developers would appreciate a PR with the more precise dependencies resolved so we can raise the bar for everyone’s baseline.