Skip to content

feat: added tests for n plus 1 queries in metrics view#7728

Merged
Zaimwa9 merged 1 commit into
mainfrom
fix/add-n-plus-1-metrics-test
Jun 8, 2026
Merged

feat: added tests for n plus 1 queries in metrics view#7728
Zaimwa9 merged 1 commit into
mainfrom
fix/add-n-plus-1-metrics-test

Conversation

@Zaimwa9

@Zaimwa9 Zaimwa9 commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Thanks for submitting a PR! Please check the boxes below:

  • I have read the Contributing Guide.
  • I have added information to docs/ if required so people know about the feature.
  • I have filled in the "Changes" section below.
  • I have filled in the "How did you test this code" section below.

Changes

  • Added tests over N+1 queries in relation to experiment metrics service

How did you test this code?

  • test

@Zaimwa9 Zaimwa9 requested a review from gagantrivedi June 8, 2026 11:54
@Zaimwa9 Zaimwa9 requested a review from a team as a code owner June 8, 2026 11:54
@vercel

vercel Bot commented Jun 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

3 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs Ignored Ignored Jun 8, 2026 11:54am
flagsmith-frontend-preview Ignored Ignored Jun 8, 2026 11:54am
flagsmith-frontend-staging Ignored Ignored Jun 8, 2026 11:54am

Request Review

@github-actions github-actions Bot added the feature New feature or request label Jun 8, 2026
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Docker builds report

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-e2e:pr-7728 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-api-test:pr-7728 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-frontend:pr-7728 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-api:pr-7728 Finished ✅ Results
ghcr.io/flagsmith/flagsmith:pr-7728 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-private-cloud:pr-7728 Finished ✅ Results

@github-actions github-actions Bot added the api Issue related to the REST API label Jun 8, 2026
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  40.6 seconds
commit  0383ad7
info  🔄 Run: #17332 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  42.8 seconds
commit  0383ad7
info  🔄 Run: #17332 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  32.4 seconds
commit  0383ad7
info  🔄 Run: #17332 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  43.2 seconds
commit  0383ad7
info  🔄 Run: #17332 (attempt 1)

@codecov

codecov Bot commented Jun 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.54%. Comparing base (19ffc62) to head (0383ad7).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7728   +/-   ##
=======================================
  Coverage   98.54%   98.54%           
=======================================
  Files        1452     1452           
  Lines       55793    55808   +15     
=======================================
+ Hits        54983    54998   +15     
  Misses        810      810           

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Visual Regression

19 screenshots compared. See report for details.
View full report

@Zaimwa9

Zaimwa9 commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

@gemini-code-assist review

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request adds a new unit test, test_list_metrics__multiple_attachments__no_n_plus_one, to api/tests/unit/experimentation/test_metric_views.py to verify that listing metrics with multiple attachments does not trigger N+1 database queries. There are no review comments, so I have no feedback to provide.

@Zaimwa9 Zaimwa9 merged commit 4aab293 into main Jun 8, 2026
33 checks passed
@Zaimwa9 Zaimwa9 deleted the fix/add-n-plus-1-metrics-test branch June 8, 2026 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api Issue related to the REST API feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants