Skip to content

[test]: return PDF from report runner#8335

Open
rijulpoudel wants to merge 2 commits into
mainfrom
issue-8330
Open

[test]: return PDF from report runner#8335
rijulpoudel wants to merge 2 commits into
mainfrom
issue-8330

Conversation

@rijulpoudel

@rijulpoudel rijulpoudel commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Fixes #8330

Summary by CodeRabbit

  • Tests
    • Added coverage for the report runner endpoint, including JSON requests and PDF responses.
    • Added validation that report data is sent correctly to the report service.
    • Removed the placeholder arithmetic test.

@github-actions

Copy link
Copy Markdown

Warning

One or more dependencies are approaching or past End-of-Life.
Please plan upgrades accordingly.

STATUS=WARNING
NODE_VERSION=20
NODE_CYCLE=20
EOL_DATE=2026-04-30
DAYS_REMAINING=-82

--- Node.js ---
Version: 20
EOL: 2026-04-30
Status: WARNING

STATUS=OK
PYTHON_VERSION=3.12
PYTHON_CYCLE=3.12
EOL_DATE=2028-10-31
DAYS_REMAINING=833

--- Python ---
Version: 3.12
EOL: 2028-10-31
Status: OK

STATUS=WARNING
DJANGO_VERSION=4.2
DJANGO_CYCLE=4.2
EOL_DATE=2026-04-07
DAYS_REMAINING=-105

--- Django ---
Version: 4.2
EOL: 2026-04-07
Status: WARNING


@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@rijulpoudel, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 44 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 5d877fcc-fa22-42d8-bea7-e1c3d452c068

📥 Commits

Reviewing files that changed from the base of the PR and between 44dc029 and ffc1d1e.

📒 Files selected for processing (1)
  • specifyweb/backend/report_runner/tests.py
📝 Walkthrough

Walkthrough

The placeholder arithmetic test is replaced with a Django test covering /report_runner/run/, including mocked query execution, report-service requests, PDF response validation, and outbound payload assertions.

Changes

Report runner endpoint testing

Layer / File(s) Summary
Validate report runner PDF response
specifyweb/backend/report_runner/tests.py
Replaces SimpleTest with TestRunReport, mocks query and report-service calls, posts JSON to the run endpoint, and verifies the PDF response, request URL, and payload fields.

Possibly related PRs

🚥 Pre-merge checks | ✅ 5 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Testing Instructions ⚠️ Warning The report-runner test covers the PDF happy path, but it doesn’t assert a single outbound /report call, so duplicate requests could still pass. Add requests_post.assert_called_once() before inspecting call_args, and keep the PDF/status assertions for the happy path.
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and directly describes the main change: report runner now returns a PDF.
Linked Issues check ✅ Passed The test updates align with #8330 by exercising the newly created report run flow and verifying the PDF response.
Out of Scope Changes check ✅ Passed The diff stays focused on the report runner test and does not introduce unrelated changes.
Automatic Tests ✅ Passed PR adds TestRunReport in report_runner/tests.py, covering the PDF endpoint with mocked query and outbound request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch issue-8330

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@specifyweb/backend/report_runner/tests.py`:
- Around line 67-68: In the test around the requests_post mock, assert that it
was called exactly once before reading call_args. Keep the existing request URL
and data argument inspections unchanged after this call-count assertion.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 9ad3d876-3b29-4012-b197-3b9948f65745

📥 Commits

Reviewing files that changed from the base of the PR and between a255ef8 and 44dc029.

📒 Files selected for processing (1)
  • specifyweb/backend/report_runner/tests.py

Comment thread specifyweb/backend/report_runner/tests.py
@github-project-automation github-project-automation Bot moved this from 📋Back Log to Dev Attention Needed in General Tester Board Jul 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Dev Attention Needed

Development

Successfully merging this pull request may close these issues.

[test]: Run the newly created report and label

2 participants