Repository navigation
test: coverage for PR #1256 (batched author profiles, article list filters, list indexes) - #1257
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
Comment on lines
+20
to
+23
| try (Connection connection = dataSource.getConnection(); | ||
| Statement statement = connection.createStatement(); | ||
| ResultSet rs = | ||
| statement.executeQuery("select name from sqlite_master where type = 'index'")) { |
Author
There was a problem hiding this comment.
🔍 Index test checks a separate database
Under SQLite :memory:, dataSource.getConnection() opens a separate database from the transaction-bound connection. DbTestBase runs the test transaction, so the index assertions fail against an unmigrated database.
Was this helpful? React with 👍 or 👎 to provide feedback.
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
Adds tests for the untested production code in #1256. This PR changes tests only.
ArticleAuthorDataLoaderTestis a DGS slice test (DgsAutoConfiguration+ArticleDatafetcher+ProfileDatafetcher+ProfileDataLoader, with mocked services). It checks thatarticles { author }callsProfileQueryService.findByUsernamesonce for the distinct authors and never callsfindByUsername. It also checks that a missing author profile produces a GraphQL error onauthor.ProfileDataLoaderTestchecks theProfilemapping, that the current user (ornullfor an anonymous request) is passed through, and that missing usernames are left out.UserReadServiceTestcovers the newfindByUsernamesmapper.ProfileQueryServiceTestadds three cases forfindByUsernames: empty input, an anonymous viewer, and no matching usernames.ArticleQueryServiceTestcovers the queries that no longer useDISTINCT:ArticleListIndexesMigrationTestchecks that the V2 Flyway indexes exist.Verification: the test sources compile (
compileTestJavapassed against the cached dependencies) and were formatted with google-java-format 1.13.0, the version Spotless uses../gradlew spotlessJavaApply testhas not been run on this VM. Maven Central returns HTTP 429, and the Google mirror hosts that Gradle is configured to use are not on the network allowlist, so some test runtime jars could not be downloaded. Please run./gradlew testbefore merging.Devin-Org: engineering
Link to Devin session: https://devin-gtm.devinenterprise.com/sessions/60c33110495b41e69ed2e5202be363af
Open in Devin Desktop: https://devin-gtm.devinenterprise.com/desktop/session/60c33110495b41e69ed2e5202be363af?variant=devin