Skip to content

[test]: return PDF from report runner - #8335

Merged
CarolineDenis merged 3 commits into
mainfrom
issue-8330
Jul 28, 2026
Merged

[test]: return PDF from report runner#8335
CarolineDenis merged 3 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 request handling and PDF responses.
    • Validated the report request payload sent to the report service (report, parameters, and serialized report data).
    • Confirmed the outbound request targets the expected report-runner URL and that the response returns HTTP 200 with application/pdf.
    • Removed the placeholder arithmetic test.

@github-actions

github-actions Bot commented Jul 21, 2026

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=-89

--- 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=826

--- 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=-112

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

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 65b12307-7852-4071-984c-e77f0e4b4035

📥 Commits

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

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

📝 Walkthrough

Walkthrough

The placeholder arithmetic test is replaced with Django coverage for /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.
🚥 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
@CarolineDenis
CarolineDenis merged commit 79c17f5 into main Jul 28, 2026
13 of 14 checks passed
@CarolineDenis
CarolineDenis deleted the issue-8330 branch July 28, 2026 09:46
@github-project-automation github-project-automation Bot moved this from Dev Attention Needed to ✅Done in General Tester Board Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅Done

Development

Successfully merging this pull request may close these issues.

[test]: Run the newly created report and label

2 participants