Skip to content

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
devin/task-15-article-list-latencyfrom
devin/tests-for-pr-1256
Open

devin-ai-integration[bot] wants to merge 1 commit into
devin/task-15-article-list-latencyfrom
devin/tests-for-pr-1256

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Summary

Adds tests for the untested production code in #1256. This PR changes tests only.

  • ArticleAuthorDataLoaderTest is a DGS slice test (DgsAutoConfiguration + ArticleDatafetcher + ProfileDatafetcher + ProfileDataLoader, with mocked services). It checks that articles { author } calls ProfileQueryService.findByUsernames once for the distinct authors and never calls findByUsername. It also checks that a missing author profile produces a GraphQL error on author.
  • ProfileDataLoaderTest checks the Profile mapping, that the current user (or null for an anonymous request) is passed through, and that missing usernames are left out.
  • UserReadServiceTest covers the new findByUsernames mapper.
  • ProfileQueryServiceTest adds three cases for findByUsernames: empty input, an anonymous viewer, and no matching usernames.
  • ArticleQueryServiceTest covers the queries that no longer use DISTINCT:
    • an article with several tags and favorites comes back, and is counted, once
    • the tag, author and favoritedBy filters combine with AND
    • an unknown author or favoriter returns 0
    • cursor paging with a tag filter works in both NEXT and PREV directions
  • ArticleListIndexesMigrationTest checks that the V2 Flyway indexes exist.

Verification: the test sources compile (compileTestJava passed against the cached dependencies) and were formatted with google-java-format 1.13.0, the version Spotless uses. ./gradlew spotlessJavaApply test has 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 test before 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


Devin Review

@devin-ai-integration

Copy link
Copy Markdown
Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Devin Review found 1 potential issue.

Custom reviewers

  • 🧪 Test 2 reviewer: no findings · View
  • 🚩 TD Enterprise Architecture: no findings · View
  • 👁️ TD Information Security: no findings · View
  • 🧠 TD French Language (Bill 96): no findings · View
  • ⏱️ TD API Contracts: no findings · View

Devin Review

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'")) {

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

🔍 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.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

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.

0 participants