Repository navigation
test(annotate): raise ui.annotate coverage and fix depth-state equals recursion - #426
Conversation
…tate UI Fix DepthCoordinatorState.equals infinite recursion (private FloatArray?.contentEquals shadowed the stdlib overload and called itself). Promote formatMeters to internal for tests.
…ator and init tests
|
Tracked by Stapler Squad backlog item: ssq://onyx.staplerhome.internal/backlog/v1/bl_01M4WBVQVMNJR6SRQP1YPW12P6 |
JVM Load Benchmark (Desktop)Synthetic in-memory benchmark measuring load performance for the desktop (JVM) app.
Flamegraphs (this PR)**Allocation** — object allocation pressure (JDBC/SQLite churn)Alloc flamegraph not available CPU — method-level hotspots by on-CPU time CPU flamegraph not available Top allocation hotspots (this PR)`33%` byte[]_[k] `6.7%` java.lang.String_[k] `5.8%` int[]_[k] `4.4%` java.util.LinkedHashMap$Entry_[k] `4.2%` java.lang.Object[]_[k]Top CPU hotspots (this PR)`96%` /usr/lib/x86_64-linux-gnu/libc.so.6 `1.3%` /tmp/sqlite-3.51.3.0-6ce1d010-b960-43dd-b972-39e011abd9c8-libsqlitejdbc.so `0.3%` __libc_pwrite `0.3%` fsync `0.3%` SR_handler |
Android Load BenchmarkInstrumented benchmark on an API 30 x86_64 emulator — 500-page synthetic graph. Comparing Graph Load
Interactive Write Latency (during Phase 3)
SAF I/O Overhead (ContentProvider vs direct File read)Measures Binder IPC cost added by ContentResolver per readFile() call.
|
Summary
ui.annotatewas 46.4% line / 27.3% branch covered (backlog item 6bc196d3). This adds tests for the ViewModel branches,DepthEstimationCoordinator, and the zero-covered BLE/permission/calibration UI via Robolectric, and fixes two bugs the tests exposed.What Changed
DepthCoordinatorState.equalsrecursed infinitely (a privateFloatArray?.contentEqualsshadowed the stdlib overload and called itself →StackOverflowError).BleDevicePanelCancel did not cancel the in-flight mock connection, so the panel flipped to Connected after Cancel.formatMetersis nowinternalfor direct unit testing.AnnotationEditorViewModelBranchTest,DepthEstimationCoordinatorTest,ParseGridRefLengthTest,FormatMetersTest.CalibrationNudgeBannerTest,PermissionRationaleDialogTest,CalibrationSheetTest,BleDevicePanelTest,SmallAnnotateDialogsTest,AnnotateEditorPartsTest,AnnotationEditorScreenRobolectricTest.project_plans/annotate-ui-test-coverage/: requirements, research, plan, validation, andcoverage-results.md+union_coverage.py.Coverage (JaCoCo,
ui.annotate)VM branch 168/198 = 84.8%;
DepthEstimationCoordinatorbranch 27/28 = 96.4%. JaCoCo cannot merge the JVM and Android reports, so the union is computed byunion_coverage.py.Test plan
./gradlew :kmp:jvmTest --tests 'dev.stapler.stelekit.*annotate*' :kmp:jacocoTestReport./gradlew :kmp:testDebugUnitTest --tests 'dev.stapler.stelekit.*annotate*' :kmp:jacocoAndroidTestReport(needsANDROID_HOME)python3 -I project_plans/annotate-ui-test-coverage/union_coverage.pyBleDevicePanel.