refactor(uts): share test infra via testFixtures, move objects unit suite into :liveobjects - #1229
Draft
sacOO7 wants to merge 1 commit into
Conversation
…uite into :liveobjects
Three related changes from the cross-SDK objects audit follow-up:
1. Shared UTS test infra (mock transport, FakeClock, SandboxApp, proxy control)
moves from :uts's src/test to its src/testFixtures variant, so other modules
can consume it via testFixtures(project(":uts")). Acyclicity invariant
documented: :liveobjects test -> :uts testFixtures -> :java, with :uts test ->
:liveobjects kept runtime-only.
2. The objects UTS unit suite moves out of :uts into the :liveobjects module's own
test source set (package io.ably.lib.liveobjects.uts.unit) so the internal-graph
specs can reach `internal` members directly. Coverage expands: adds
InternalLiveCounter/Map, ObjectId, ObjectsPool and ParentReferences suites.
runLiveObjectsUnitTests now covers both .unit.* and .uts.unit.*.
3. Spec-conformance in production source:
- op-path applyObject/applyOperation now returns the ObjectUpdate instead of a
Boolean (RTLC9g/RTLM7f); the RTO9a2a4 on-ack gate uses !update.noOp.
- root object is excluded from GC (RTO10c1b1) and rejects tombstone attempts
(RTLO4e10); both covered by new tests.
Deviations recorded in liveobjects/.../uts/deviations.md. Unit suites and the CI
static-analysis gate are green.
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Summary
Follow-up to the cross-SDK objects audit. Three related changes, bundled because the test move and the production conformance work touch the same suites:
:uts'ssrc/testinto itssrc/testFixturesvariant, so other modules can consume it viatestFixtures(project(":uts")).:liveobjectsmodule's own test source set, so the internal-graph specs can reachinternalmembers directly (and expand coverage).ObjectUpdate, plus two root-object safeguards.Based on
fix/liveobjects-objects-audit-op-handling(notmain).Related spec
Mirrors the spec changes in ably/specification#512 into the ably-java derived tests and source:
LiveObjectUpdate; the internal-counter/map UTS tests assert the returned update directly.call_count == 1.Changes
1. Test infra →
testFixturesFakeClock,SandboxApp, proxy control) move touts/src/testFixtures/kotlin/io/ably/lib/uts/infra/— pure moves, no content change.:utsgains thejava-test-fixturesplugin; fixture deps scopedtestFixturesApi/testFixturesImplementation.uts/build.gradle.kts)::liveobjects test → :uts testFixtures → :java, with:uts test → :liveobjectskepttestRuntimeOnly.testFixturesmust never depend on:liveobjects.2. Objects UTS unit suite →
:liveobjects:uts→liveobjects/src/test/.../uts/unit/(packageio.ably.lib.liveobjects.uts.unit).InternalLiveCounter,InternalLiveMap,ObjectId,ObjectsPool,ParentReferences.runLiveObjectsUnitTestsnow filters bothio.ably.lib.liveobjects.unit.*andio.ably.lib.liveobjects.uts.unit.*— CI coverage preserved, no integration tiers pulled in.liveobjects/.../uts/deviations.md(manual's format; S/T shape/typed vocabulary).3. Production spec-conformance (
liveobjects/src/main)ObjectUpdateinstead ofBoolean(RTLC9g/RTLM7f). The RTO9a2a4 on-ack serial gate now uses!update.noOp, matching the UTS model whereresult == true ⟺ !update.noop.LiveObjectTombstoneTest).Verification
:liveobjects:runLiveObjectsUnitTests+:uts:runUtsUnitTests— green, unit-only (0 integration tests).checkWithCodenarc checkstyleMain checkstyleTest— green.Follow-up TODOs (draft — from
FUTURE_WORK_UTS_INFRA.md)Deferred intentionally; do not do speculatively. Trigger = a second infra consumer beyond
:liveobjects.:test-supportmodule (rename pkgio.ably.lib.uts.infra→io.ably.lib.testsupport); dropjava-test-fixturesfrom:uts.:javafor its UTS-derived tests — guardrail: keepkotlin-stdlibout of:java's main artifact.uts-package-mapping.jsonto one full path per tier (droptestRoot+{root,path}form; simplifyresolve_uts.py).Notes for reviewers
Read as three changes, not move noise — the op-path return and the root-object safeguards are behavioural.
FUTURE_WORK_UTS_INFRA.mdcaptures the deferred extraction and its rationale.