fixes #31125
- Move legacy tests into a separate directory. - Reduce common dependencies between targets.