Skip to content

dataconnect(test): QueryCachingIntegrationTest.kt added#7854

Merged
dconeybe merged 1 commit intomainfrom
dconeybe/dataconnect/MaxAge2
Feb 28, 2026
Merged

dataconnect(test): QueryCachingIntegrationTest.kt added#7854
dconeybe merged 1 commit intomainfrom
dconeybe/dataconnect/MaxAge2

Conversation

@dconeybe
Copy link
Contributor

@dconeybe dconeybe commented Feb 27, 2026

This PR adds QueryCachingIntegrationTest.kt to dataconnect's integration test suite. It performs some basic tests that results are served from cache when expected. The suite will be enhanced to test entity normalization in a future PR.

Highlights

  • QueryCachingIntegrationTest Added: Added QueryCachingIntegrationTest to test that QueryRef.execute() returns cached or non-cached results, depending on the scenario.
  • Enhanced Test Utilities: Introduced a Quintuple data class, similar to the Triple class from the Kotlin standard library.

Changelog

Changelog
  • DataConnectBackend.kt:
    • Refactored DataConnectBackend interface to accept CacheSettings for getDataConnectSettings and getDataConnect functions.
    • Removed unused imports related to DataConnectBackend sealed classes.
  • TestDataConnectFactory.kt:
    • Added new newInstance overloads to TestDataConnectFactory to support CacheSettings.
    • Updated createInstance to pass CacheSettings to the DataConnectBackend.
    • Included cacheSettings in TestDataConnectFactory.Params.
  • TestConnectorFactory.kt:
    • Modified TestConnectorFactory to accept CacheSettings in its createInstance method.
    • Updated dataConnectSettings retrieval to use getDataConnectSettings(params).
  • QueryCachingIntegrationTest.kt:
    • Added a new file containing integration tests for query caching.
    • Tests various combinations of CacheSettings (disabled, memory, persistent), maxAge (1.hour, 1.nanosecond, ZERO), and FirebaseDataConnect instance usage (same, new).
    • Utilizes property-based testing with Kotest.
  • KotestTestutilPrinters.kt:
    • Added QuintuplePrint to register a custom printer for the Quintuple class in Kotest.
  • Quintuple.kt:
    • Added a new data class Quintuple to hold five values, extending test utility functionality.

@gemini-code-assist
Copy link
Contributor

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

@github-actions
Copy link
Contributor

📝 PRs merging into main branch

Our main branch should always be in a releasable state. If you are working on a larger change, or if you don't want this change to see the light of the day just yet, consider using a feature branch first, and only merge into the main branch when the code complete and ready to be released.

@dconeybe dconeybe marked this pull request as ready for review February 27, 2026 21:18
@dconeybe
Copy link
Contributor Author

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces integration tests for query caching, which is a great addition. The refactoring to support passing CacheSettings is clean and well-executed throughout the modified files. I've found one potential issue in the new test file regarding test isolation in property-based tests, for which I've left a comment with a suggestion.

@dconeybe dconeybe merged commit f6b7f42 into main Feb 28, 2026
43 checks passed
@dconeybe dconeybe deleted the dconeybe/dataconnect/MaxAge2 branch February 28, 2026 01:48
@github-actions github-actions bot mentioned this pull request Feb 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants