Skip to content

RUM-17613 Add integration tests for timeseries collection - #3713

Closed
satween wants to merge 4 commits into
tvaleev/feature/RUM-17613-2-timeseries-schemafrom
tvaleev/feature/RUM-17613-3-integration-tests
Closed

RUM-17613 Add integration tests for timeseries collection#3713
satween wants to merge 4 commits into
tvaleev/feature/RUM-17613-2-timeseries-schemafrom
tvaleev/feature/RUM-17613-3-integration-tests

Conversation

@satween

@satween satween commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds TimeseriesTrackingPlaygroundActivity and an instrumented TimeseriesCollectionTest that
run the real collection pipeline against the mock RUM server: CPU and memory batches are emitted
with the expected sample counts, leaving the foreground flushes the pending batch, nothing is
collected while backgrounded, and collection resumes on return to the foreground.

Motivation

The unit tests cover the pipeline pieces in isolation; nothing exercised the whole
executor-driven path with real readers and real lifecycle transitions, which is where the
suspend/flush timing actually matters.

Additional Notes

The integration module consumes testFixtures(project(":features:dd-sdk-android-rum")) and
excludes tools:unit, a JVM-only test module that must not land on the Android test classpath;
gson and jUnit4 are added as testFixturesImplementation so the androidTest consumer still
has them at runtime.

Requires a connected device or emulator:
./gradlew :instrumented:integration:connectedDebugAndroidTest.

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Make sure you discussed the feature or bugfix with the maintaining team in an Issue
  • Make sure each commit and the PR mention the Issue number (cf the CONTRIBUTING doc)

Ref: RUM-17613

satween commented Aug 14, 2026

Copy link
Copy Markdown
Contributor Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Aug 14, 2026

Copy link
Copy Markdown

Pipelines  Tests

Unblock PR with BitsAI

⚠️ Warnings

🚦 3 Pipeline jobs failed

DataDog/dd-sdk-android | test-pyramid:legacy-integration-instrumented-latest-api   View in Datadog   GitLab

DataDog/dd-sdk-android | test-pyramid:legacy-integration-instrumented-min-api   View in Datadog   GitLab

DataDog/dd-sdk-android | test-pyramid:legacy-integration-instrumented-median-api   View in Datadog   GitLab

ℹ️ Info

No other issues found (see more)

🧪 All tests passed
❄️ No new flaky tests detected

🔄 Datadog retried 1 test - 1 passed on retry View in Datadog

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 72.82% (+0.00%)

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 43297b9 | Docs | Datadog PR Page | Give us feedback!

@satween

satween commented Aug 14, 2026

Copy link
Copy Markdown
Contributor Author

Instrumented run status:

  • :instrumented:integration:connectedDebugAndroidTest --tests TimeseriesCollectionTest on
    API 28 — both tests pass, 3 consecutive runs (no timing flakiness observed).
  • ⚠️ The suite cannot run on API 23: every AssertJ assertion dies in
    ConfigurationProvider.<clinit> with
    NoClassDefFoundError: Failed resolution of: Ljava/util/Spliterators; (that class only
    exists from API 24, and tools:javabackport behind -Puse-api21-java-backport backports
    only CompletableFuture, Path, DirectoryStream and LongAdder). Not specific to this
    PR — the pre-existing security.EncryptionTest fails identically on the same AVD.

@codecov-commenter

codecov-commenter commented Aug 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (tvaleev/feature/RUM-17613-2-timeseries-schema@1c35566). Learn more about missing BASE report.

Additional details and impacted files
@@                               Coverage Diff                                @@
##             tvaleev/feature/RUM-17613-2-timeseries-schema    #3713   +/-   ##
================================================================================
  Coverage                                                 ?   73.38%           
================================================================================
  Files                                                    ?     1012           
  Lines                                                    ?    37094           
  Branches                                                 ?     6390           
================================================================================
  Hits                                                     ?    27221           
  Misses                                                   ?     8043           
  Partials                                                 ?     1830           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Rename the internal Timeseries interface to TimeseriesCollector and rename its
implementations to DefaultTimeseriesCollector and
DefaultTimeseriesCollectorFactory, propagating the new names through
RumFeature, the RUM scope tree and the tests. No behaviour change.

Ref: RUM-17613
@satween
satween force-pushed the tvaleev/feature/RUM-17613-3-integration-tests branch from 53d8975 to 0c453b4 Compare August 14, 2026 13:00
@satween
satween force-pushed the tvaleev/feature/RUM-17613-2-timeseries-schema branch from c932d24 to e6e92e4 Compare August 14, 2026 13:00
Replace the collector's four-state enum with a generation-counted state and
schedule a 200 ms deferred suspension when the app leaves the foreground, so the
buffered batch is written instead of dropped. Sampling only runs on a foreground
view, which makes the collectInBackground switch obsolete.

Ref: RUM-17613
Derive the CPU and memory timeseries schemas from _common-schema.json and
replace the hand-written JSON serializers with typed event factories that
populate the full common event shape (os, device, connectivity, dd, ddtags).
Restrict collection through TimeseriesConfiguration.collectOnly.

Ref: RUM-17613
Add a playground activity and an instrumented test that assert CPU and
memory timeseries are collected, flushed on backgrounding and resumed on
return to foreground.

Ref: RUM-17613
@satween
satween force-pushed the tvaleev/feature/RUM-17613-3-integration-tests branch from 0c453b4 to 43297b9 Compare August 14, 2026 13:41
@satween
satween force-pushed the tvaleev/feature/RUM-17613-2-timeseries-schema branch from e6e92e4 to 1c35566 Compare August 14, 2026 13:41
@satween
satween force-pushed the tvaleev/feature/RUM-17613-2-timeseries-schema branch from 1c35566 to a2fbff9 Compare August 14, 2026 14:32
@satween

satween commented Aug 14, 2026

Copy link
Copy Markdown
Contributor Author

Superseded: branch renamed to tvaleev/feature/RUM-17613-4-integration-tests to match the new stack order. Replaced by #3718.

@satween satween closed this Aug 14, 2026
@satween
satween deleted the tvaleev/feature/RUM-17613-3-integration-tests branch August 14, 2026 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants