Skip to content

feat(ci): Add opt-in offline persistence for E2E tests - #2853

Merged
testableapple merged 2 commits into
masterfrom
feature/FLU-643_enable_offline_persistence_in_e2e
Jul 29, 2026
Merged

testableapple merged 2 commits into
masterfrom
feature/FLU-643_enable_offline_persistence_in_e2e

Conversation

@VelikovPetar

@VelikovPetar VelikovPetar commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor

Submit a pull request

Linear: FLU-643

CLA

  • I have signed the Stream CLA (required).
  • The code changes follow best practices
  • Code changes are tested (add some information if not applicable)

Description of the pull request

  • Adds persistence opt-in flag on the streamTestWithEnv: When on - wires a StreamChatPersistenceClient in the ChatClient undergoing the test
  • Clears the DB on test cleanup

Summary by CodeRabbit

  • New Features

    • Added optional persistence controls for stream connection setups.
    • Persistence can now be enabled for applicable integration test environments.
  • Bug Fixes

    • Improved handling of chat persistence when connection overrides are used.
    • Reset actions now flush and clear persisted chat state for a cleaner restart.

@coderabbitai

coderabbitai Bot commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Integration test helpers now accept a persistence option, propagate it through StreamTestEnv, and configure connection overrides. The authentication controller conditionally enables persistence for overrides and flushes persisted state during debug reset.

Changes

Persistence Configuration

Layer / File(s) Summary
Persistence policy and reset behavior
sample_app/lib/auth/auth_controller.dart
StreamConnectionOverride adds usePersistence; client construction conditionally selects persistence for overrides, and debugReset flushes persisted state.
Integration test persistence wiring
sample_app/integration_test/support/stream_test_case.dart, sample_app/integration_test/support/stream_test_env.dart
Test helpers accept persistence and pass it through environment setup into StreamConnectionOverride.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: testableapple

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly captures the main change: opt-in persistence support for E2E tests.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Fix failing CI checks
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/FLU-643_enable_offline_persistence_in_e2e

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@VelikovPetar VelikovPetar changed the title feat(test): Add opt-in offline persistence for E2E tests feat(ci): Add opt-in offline persistence for E2E tests Jul 29, 2026
@VelikovPetar
VelikovPetar requested review from a team and testableapple July 29, 2026 16:59
@VelikovPetar
VelikovPetar marked this pull request as ready for review July 29, 2026 16:59

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@sample_app/lib/auth/auth_controller.dart`:
- Around line 273-274: Replace the invalid closePersistenceConnection call in
debugReset() with a publicly supported Stream persistence cleanup or shutdown
path that clears the database before the next test. If no public cleanup API is
available, remove this teardown call rather than relying on the non-public
method.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: a56f7584-c2c2-4535-be84-0be1e5924582

📥 Commits

Reviewing files that changed from the base of the PR and between 2507ca5 and 6d9f6a1.

📒 Files selected for processing (3)
  • sample_app/integration_test/support/stream_test_case.dart
  • sample_app/integration_test/support/stream_test_env.dart
  • sample_app/lib/auth/auth_controller.dart

Comment thread sample_app/lib/auth/auth_controller.dart
@codecov

codecov Bot commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.83%. Comparing base (2507ca5) to head (6d9f6a1).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2853   +/-   ##
=======================================
  Coverage   72.83%   72.83%           
=======================================
  Files         428      428           
  Lines       27657    27657           
=======================================
  Hits        20144    20144           
  Misses       7513     7513           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@testableapple testableapple left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🙌

@testableapple
testableapple merged commit b85e63a into master Jul 29, 2026
35 of 37 checks passed
@testableapple
testableapple deleted the feature/FLU-643_enable_offline_persistence_in_e2e branch July 29, 2026 19:32
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