Repository navigation
Description
Child of #161 (item 3). Split out during feature intake. The shapes named in this issue (several
[Compose<TProfile, TConfig>(...)]attributes,[InlineData]/[MemberData]interop, a static-member config source) are candidates to compare. None is an approved design.
Motivation
Consumer scenario (#161, Compono 1.3.2 migration): a table-driven theory where each row varies composed configuration (option values, a clock instant) together with expected values. A 6-row table became 6 test methods plus a shared assertion helper. DateTimeOffset and other values that aren't attribute-legal need a string stand-in in the config record.
What Compono does today (validated against main):
- Exactly one Compose-family attribute per test method.
AllowMultiple = falsemakes a second instance of the same closed attribute type a compiler error. Different closed types ([Compose]+[Compose<P>]) compile but are rejected at runtime byBindingPlan.ValidateSignature(Compono.XunitV3), and at compile time byCMP0045(Compono.XunitV3.Aot). - ADR-0022 Decision Outcome rejected both stacking Compose attributes and combining
[Compose]with[InlineData]/[MemberData]. ADR-0022 Amendment 7 (2026-08-04) kept that restriction only because no real call site existed yet and left a pointer for future dogfooding evidence. [Feature]: Test-composition gaps: cross-category log capture, metrics testing, multi-attribute theories and runtime values in profiles #161 is the first real call site. [Compose<TProfile, TConfig>(...)]arguments must be attribute constants (ADR-0036).[Compose(42, ...)]inline values exist on the JIT package but not yet onCompono.XunitV3.Aot(deferred phase per PLAN-0066/0067).Compono.XunitV3'sComposeAttributereturns one row withSupportsDiscoveryEnumeration() => false. The AOT path registersRegisteredEngineConfig.RegisterTheoryDataRowFactory(...), whose factory already returnsIReadOnlyCollection<ITheoryDataRow>. That makes multi-row emission structurally available on the AOT path without a parallel mechanism.
Workaround in use: one test method per row plus a shared assertion helper, and string stand-ins for non-constant config values.
Classification: a missing capability. The restriction is a documented, intentional limit (ADR-0022 and Amendment 7), not a bug. This is the evidence Amendment 7 said would justify reopening it.
Proposed solution
Consumer requirement (outcome, not API): one theory method can express N cases. Each case can vary (a) the profile configuration applied to composition, (b) any non-composed values the test needs (expected results), and (c) values not expressible as attribute constants. Each case is reported and reproducible as its own row.
Acceptance criteria
- A single test method can declare multiple rows, each with its own profile configuration and its own non-composed (expected) values. Composed parameters are still composed per row.
- A row can carry configuration values that are not attribute constants (for example
DateTimeOffset) without a string stand-in, or the ADR explicitly scopes this out with a justification. - Each row gets its own seed,
Compono.Seedtrait and failure message. Row identity and display names are deterministic and distinguishable in test explorers and CI output. - Supported on
Compono.XunitV3andCompono.XunitV3.Aotwith equivalent semantics, or an explicit, documented divergence. The AOT path builds on the existingRegisterTheoryDataRowFactoryemission, not a parallel mechanism. - Invalid combinations are rejected with clear diagnostics: compile-time
CMPxxxxwhere the generator can see the shape, and clearCompositionExceptions on the JIT path. - Existing single-attribute tests are unchanged (source and behavior).
- A cross-framework position for
Compono.TUnit/Compono.NUnit/Compono.MSTestis recorded: in scope, deferred, or not applicable.
Relevant packages: Compono.XunitV3, Compono.XunitV3.Aot, Compono.Generators (AOT emission, diagnostics, possibly JIT-side discovery), and core Compono only if row binding needs a new seam. The other framework packages are affected only through the consistency question.
Research questions (design dive before an ADR)
- Which shape? Compare at least:
(a) several Compose-family attributes per method, one row each (needsAllowMultiple = true, a public attribute-contract change, and reverses the ADR-0022 restriction);
(b)[Compose...]plus xUnit's own[InlineData]/[MemberData]/[ClassData], with xUnit supplying the leading non-composed values and Compono composing the rest;
(c) a Compono-owned row source (for example a static member returning rows of config plus expected values), MemberData-style;
(d) a hybrid.
Weigh discoverability, IDE experience, AOT feasibility, and fit with xUnit idioms (capability-admission Gate A criterion 2). - How do xUnit v3 (JIT) and xUnit v3 AOT combine rows from multiple data sources on one method? What happens to row identity when a
SupportsDiscoveryEnumeration() == falsesource is involved (one test case versus N in Test Explorer)? - Binding: positional versus named binding of non-composed values; how inline values, profile configuration arguments and composed parameters coexist without ambiguity (ADR-0036 already separates "inline values" from "profile configuration arguments").
- Non-constant config: is a static member reference (field, property or method) acceptable under the generator-first, no-reflection posture? On JIT,
MemberDatauses reflection; on AOT the generator must emit a direct call. Which member shapes get diagnostics? - Composer and profile caching per row: today the composer is cached per attribute instance. What changes when one method has N configurations?
- Does the AOT inline-values gap (deferred in PLAN-0066/0067) need to close first, or can rows vary config only?
- Cross-framework: do TUnit/NUnit/MSTest need the same capability now, or does each framework's own row model (TUnit data sources, NUnit
IParameterDataSource) make it a separate question?
Compatibility / AOT / performance: any AllowMultiple or attribute-shape change is public API, so stay additive only. New CMPxxxx diagnostics. Generated row factories stay low-allocation. JIT-path reflection must not grow beyond the existing ConfigProfileBinder pattern without justification.
Explicit non-goals
- Reproducing AutoFixture's
[InlineAutoData]feature for feature. - Discovery-time (pre-enumerated) composition of row values.
- Runtime fixture values in profiles ([Feature]: Runtime fixture values in composition profiles (xUnit class/collection fixtures) #162; see dependencies).
- Changing single-attribute behavior.
Relationship / dependencies: child of #161 (item 3). Reopens the question ADR-0022 Amendment 7 deferred, so the outcome should be recorded as a new ADR or a dated amendment, per the ADR rules. Soft dependency on #162 (runtime fixture values): both are about feeding non-constant values into profile configuration, so research question 4 should be answered with that item's outcome in view and not settled independently. Possible dependency on AOT inline-value support (PLAN-0066/0067 deferred phase).
Suggested process: deep design dive (more than one plausible shape, several packages, public attribute contract), then an ADR. A short research note may be needed for xUnit multi-source row semantics (question 2), which should be verified empirically. Highest architectural risk of the four #161 items.
Activity
ncipollina commentedon Nov 4, 2026
Design constraint from #162: composed rows must stay execution-time (delayed-enumerated).
RESEARCH-0037 §4–§6 and §12 established this, and it's carried forward as ADR-0069's "Constraint carried forward". (The research doc, ADR-0069 and PLAN-0070 are on the upcoming
feat/162-require-fixturebranch and aren't merged tomainyet, so these links resolve once that lands.)Why it matters. #162's supported way for a profile to read an xUnit fixture (
TestContext.Current.GetFixture(...)today,TestContext.Current.RequireFixture<TFixture>()per ADR-0069) works only because Compono composes theory rows during test-method execution, after xUnit has created and initialized every class, collection and assembly fixture:Compono.XunitV3:ComposeAttribute.SupportsDiscoveryEnumeration() => falseCompono.XunitV3.Aot: the generatedRegisterTheoryDataRowFactory(..., disableDiscoveryEnumeration: true, ...)We verified it under JIT and a real Native AOT publish (xUnit 4.0.1). Profile construction,
Configure, and registration factories all ran atTestPipelineStage.TestMethodExecutionwith fixtures available. None ran during discovery.Constraint for #163's design.
Configure-time state for per-row values.Compono.XunitV3(JIT) runsTProfile.Configureonce per attribute instance (aLazy<Composer>), whileCompono.XunitV3.Aotruns it per row. Per-row variation has to flow through registration factories or a new explicit mechanism, not through state captured inConfigure.docs(xunitv3): streamline ComposeData completion plan
feat(xunitv3): support composed theory rows with ComposeData (#169)
docs(plan): mark ComposeData plan complete (#170)