feat: Add template parameter support for test_target_path#142
feat: Add template parameter support for test_target_path#142adurymanov wants to merge 7 commits intoBarredEwe:mainfrom
Conversation
- Add ConfigPathResolver utility with clean parameter interface
- Support {{target}} and {{testTarget}} placeholders
- Apply to test_target_path configuration only
- Comprehensive unit tests (18 test cases) and integration tests
- Backward compatible with existing configurations
Useful for multi-target projects and monorepos.
Also: Add .serena/ to .gitignore
|
@adurymanov Hi! Thanks for improving Prefire. Great idea! I only have one request: please use the names Will you be able to do this |
4fd50b1 to
d1e4389
Compare
- Add OptionsResolver for shared path/template resolution - Create CLITestsOptions and CLIPlaybookOptions structs for raw CLI input - Refactor GeneratedTestsOptions and GeneratedPlaybookOptions with factory methods - Move ConfigPathResolver.resolve() call to factory after CLI+config merge - Fix variable shadowing (config -> loadedConfig) - Change options properties from var to let (immutable) - Update tests to use new factory pattern 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
d1e4389 to
7c897d2
Compare
|
@BarredEwe I’ve renamed the variable placeholders to ${TARGET} and ${TEST_TARGET}. However, I’m not sure it’s either possible or necessary to integrate path resolution into the config decoder, since there are two sources for target paths: the config file and CLI parameters. If the resolver were integrated into the config, it would have to be duplicated in the CLI as well. Instead, to avoid code duplication, I added factories for the Tests and Playbook command parameters that merge the CLI inputs with configs and then resolve the paths. This also guarantees that the correct values are always used for the TARGET and TEST_TARGET variables. |
Summary
Introduces
{{target}}and{{testTarget}}placeholders in thetest_target_pathconfiguration, allowing dynamic path resolution across multiple targets.This change is fully backward-compatible.
Motivation
Previously, multi-target projects required duplicating configuration entries for each target.
With this update, a single flexible pattern can be used instead.
Before:
After:
Changes
ConfigPathResolverutility with a simplified public APIGeneratedTestsOptionsExamples
Benefits
Testing
All existing path resolution scenarios (absolute, relative, test target name) remain valid and verified.
Also includes:
.serena/to.gitignore