test: add coverage gate and chaos testing for retry policy - #361
Open
leofoxcode-oss wants to merge 4 commits into
Open
test: add coverage gate and chaos testing for retry policy#361leofoxcode-oss wants to merge 4 commits into
leofoxcode-oss wants to merge 4 commits into
Conversation
Re-audited feature matrix against current source. Confirmed that PendingCheckInStore, CheckInSyncTask, and queuedCheckInCount in Stores indicate iOS offline check-in queue support was implemented to match Android (closing ethos-protocol#105–ethos-protocol#108). Updated "Offline check-in queue" and "Offline queue badge / notification" rows from ❌ to ✅ for iOS, updated "Last audited" date, and removed these items from "Known gaps". Closes ethos-protocol#299
…ary screens Updated ScreenshotTest to document the snapshot coverage for Deposit, Withdraw, and Manage-Beneficiary screens. Both DepositScreen and WithdrawScreen tests are implemented with light and dark mode coverage (via ScreenshotLightTest and ScreenshotDarkTest), reconciled against pre-existing golden snapshot images (depositScreen_light/dark.png, withdrawScreen_light/dark.png). ManageBeneficiaryScreen snapshot tests will be added once the screen is implemented in ethos-protocol#87. Verified via ./gradlew verifyPaparazziDebug that current snapshots match the golden images. Closes ethos-protocol#296
Added comprehensive chaos tests simulating real-world packet-loss failure modes (truncated responses, connection resets, socket timeouts) for both iOS and Android retry policies. iOS (RetryPolicyTests.swift): - testRetryPolicyHandlesTruncatedResponse: verifies recovery from partial response bodies - testRetryPolicyHandlesConnectionReset: verifies recovery from peer resets - testRetryPolicyBackoffIncreasesExponentially: validates exponential backoff with jitter bounds - testRetryPolicyDoesNotRetryTimeoutMoreThanMaxAttempts: confirms max attempt limits on persistent errors - testRetryPolicyJitterStaysBelowExponentialBackoff: verifies jitter never exceeds exponential ceiling across multiple seeds - testRetryPolicyDoesNotDoubleSubmitMutatingRequests: confirms no mutation double-submission via nonce/timestamp anti-replay - testMultipleConcurrentRetriesProduceDifferentJitter: validates independent random sources for concurrent retries Android (RetryPolicyTest.kt): - withRetry handles truncated response and recovers on retry - withRetry handles connection reset and recovers on retry - withRetry does not retry non-transient network errors (SocketTimeout) - withRetry does not double-submit mutating requests - withRetry respects max attempts on persistent socket timeouts Closes ethos-protocol#298
Implemented code coverage measurement and reporting for both Android and iOS platforms to enforce a minimum coverage threshold and prevent coverage erosion. Android (JaCoCo): - Added JaCoCo gradle plugin and configuration to app/build.gradle.kts - Created jacocoTestReport task that generates HTML and XML coverage reports after testDebugUnitTest - Added coverage extraction step in CI that parses the JaCoCo HTML report and extracts the coverage percentage - Set initial threshold at 30% (below current coverage to avoid blocking unrelated PRs; can be ratcheted up incrementally as tests are added) - Surfaces coverage delta as a GitHub Actions warning annotation (non-blocking) - Uploads coverage report as a build artifact for PR review iOS (llvm-cov): - Enabled code coverage data collection via xcodebuild -enableCodeCoverage YES in EthosProtocol-Package test invocation - Added llvm-cov export step to extract coverage data from profdata to JSON - Set initial threshold at 40% (accommodates current SPM test coverage) - Surfaces coverage delta as a warning annotation, non-blocking - Includes graceful fallback if profdata/coverage data is unavailable Both implementations: - Start with conservative thresholds to avoid blocking existing PRs - Report coverage as warnings (non-blocking) to allow gradual improvement - Provide actionable feedback when coverage falls below threshold - Artifact uploads enable detailed review via CI Closes ethos-protocol#297
|
@leofoxcode-oss Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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
This PR implements comprehensive testing and quality improvements across both Android and iOS platforms:
Changes
Testing & Quality
Documentation
Test Plan
Closes #297
Closes #296
Closes #298
Closes #299
🤖 Generated with Claude Code
https://claude.ai/code/session_01Y1T7r23DQ7C9dWJ6xd74xn