Skip to content

Add shared fields and cases alias to @ObjectSource#186

Merged
em3s merged 5 commits intomainfrom
feat/issue-185-objectsource-all-tests
Feb 6, 2026
Merged

Add shared fields and cases alias to @ObjectSource#186
em3s merged 5 commits intomainfrom
feat/issue-185-objectsource-all-tests

Conversation

@em3s
Copy link
Contributor

@em3s em3s commented Feb 6, 2026

Summary

Add shared and cases parameters to @ObjectSource annotation, enabling shared fields that merge into every test case. This keeps YAML self-contained and eliminates duplication of common setup data across test cases.

Closes #185

Plan

  • Add shared and cases parameters to ObjectSource annotation (backward compatible)
  • Update ObjectSourceExtension processor: resolve test data from cases.ifBlank { value }, parse and merge shared fields into every test case
  • Add tests for: cases alias, shared merge, shared + cases combined, backward compatibility
  • Update testing-guide.md with shared/cases usage examples (in root agent SSOT, not in this PR)

Closes #185

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. enhancement New feature or request module:core labels Feb 6, 2026
- Add `tests` (alias for `value`) and `all` (shared fields) parameters
  to @ObjectSource annotation with empty string defaults for backward
  compatibility
- Update ObjectSourceExtension to resolve test data from
  `tests.ifEmpty { value }` and merge `all` fields into every test case
- Per-case fields override `all` fields via map concatenation
- Add tests: tests alias, all merge, all+tests combined, override
  behavior, backward compatibility

Closes #185

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. labels Feb 6, 2026
- Reject simultaneous use of `value` and `tests` parameters
- Require at least `value` or `tests` to be provided
- Use `ifBlank` instead of `ifEmpty` for consistent whitespace handling
- Replace `assert()` with `assertTrue()` for better failure messages
- Add test for `all` + `value` (positional) combination

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@em3s
Copy link
Contributor Author

em3s commented Feb 6, 2026

Review Round 1

Issues Found & Fixed

Severity Issue Status
WARNING value and cases used simultaneously — silent discard Fixed: require() rejects both
WARNING Empty cases/value with shared — Jackson error Fixed: require() guard
WARNING Missing test for shared + value (positional) Fixed: added test
SUGGESTION assert()assertTrue() for better failure messages Fixed
SUGGESTION ifEmptyifBlank for consistent whitespace handling Fixed
SUGGESTION KDoc for annotation parameters Skipped: minimal infrastructure code, usage documented in testing-guide.md

Result

All tests passing. No CRITICAL/HIGH issues remain.

@em3s em3s self-assigned this Feb 6, 2026
@em3s em3s changed the title feat(core): add all shared fields and tests alias to @ObjectSource feat(core): add shared fields and cases alias to @ObjectSource Feb 6, 2026
… → `cases`

Clearer naming: `shared` conveys "shared across all cases", `cases` is more
precise than "tests" for what the parameter actually holds.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@em3s em3s merged commit 426185a into main Feb 6, 2026
9 checks passed
@em3s em3s changed the title feat(core): add shared fields and cases alias to @ObjectSource Add shared fields and cases alias to @ObjectSource Feb 12, 2026
@em3s em3s deleted the feat/issue-185-objectsource-all-tests branch March 1, 2026 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add shared fields and cases alias to @ObjectSource

1 participant