Carry group-level <capability> onto each test result - #122
Open
bryantaustin13 wants to merge 1 commit into
Open
Conversation
A <capability> on a <group> applies to every test in it, but Result only ever read the test's own, so group declarations were dropped. 996 of the 1,016 groups in the suite declare one, and 1,670 tests declare none of their own — those tests reported no capabilities at all. The reported capabilities are now the union of the test's own and its group's, deduplicated by code with the test's entry winning, since it is the more specific declaration. Most tests restate their group's capability, so for them the union is unchanged; the gain is for the tests that declare none. Measured against cql-tests/tests/connectathonTests, 2,035 tests loaded: tests reporting no capability drop from 469 to 39. The single-vs-array normalization already needed for test capabilities applies equally to group ones, so it is factored into normalizeCapabilities and shared. TestGroup.capability is typed CapabilityKV | CapabilityKV[] to match, and the group is passed at all three Result call sites — the loader and both server entry points — so the CLI and server paths agree.
bryantaustin13
added a commit
that referenced
this pull request
Aug 18, 2026
Ports the timezone-offset policy feature onto the deduped runner and drops the
parts main has since covered.
Dropped, both entirely superseded:
test-types.ts, results-shared.ts this branch's groupCapability work. Nothing
emitted the field, so it collected data that
never reached the results file; #122 reports
group capabilities through the existing
capabilities field instead. Took main's
versions of both files.
test-runner.ts #117 moved the per-test logic into
shared/run-test-core.ts, so the 260 lines
this branch added there are ported rather
than restored. Took main's version.
Ported into run-test-core.ts, so the CLI and server paths share it:
- policy resolution (metadata -> env/config -> probe -> default), run once per
execution context rather than per test
- a skip arm for tests declaring a timezone-offset-policy capability that does
not match the server's
- {{SERVER_OFFSET_ISO}} substitution, applied to result.expression before the
request is built so the expression sent and the expression reported match
Two changes from the original while porting:
Resolution is gated on the loaded suite actually containing a policy-dependent
test. It costs a metadata request and possibly a probe expression, and almost no
suite consults it; doing it unconditionally also broke tests that stub CQLEngine
or sequence fetch mocks.
The required policy is read from result.capability rather than test.capability.
In CQLTimeZoneOffsetTest.xml the policy is declared on the <group>, and one of
the three groups does not restate it on its tests — reading only the test level
silently never gated those. This depends on #122 to see group capabilities;
until that merges, group-level declarations still are not visible.
The probe now uses fetch only, since the dedupe removed the axios path, and
CQLEngine gains a serverMetadata getter so the resolution can read the
CapabilityStatement without reaching into a private field.
raleigh-g-thompson
approved these changes
Aug 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A
<capability>on a<group>applies to every test inside it, butResultonly ever read the test's own, so group declarations were dropped entirely. In the suite:<capability>Measured against
cql-tests/tests/connectathonTests(2,035 tests loaded), tests reporting no capability drop from 469 to 39.Changes
results-shared.ts— reported capabilities are now the union of the test's own and its group's, deduplicated bycodewith the test's entry winning, since it is the more specific declaration. Most tests restate their group's capability, so for them the union is identical to what was reported before; the gain is for the tests declaring none.normalizeCapabilitiesand shared rather than duplicated.test-types.ts—TestGroup.capabilitytypedCapabilityKV | CapabilityKV[]to match what the XML parser produces, consistent withTest.capability.Resultcall sites — the loader plus both server entry points — so the CLI and server paths report the same capabilities.tsc --noEmitclean, 194 tests passing. No schema change needed — this populates the existingcapabilitiesfield rather than adding one.Split out of #119
#119 carried a
groupCapabilityfield for this, but nothing ever emitted it, so as written it collected data that never reached the results file. This reports the capabilities through the existing field instead, and is independent of #119's timezone work.