Skip to content

Assert parsed source cache population#3546

Merged
koxudaxi merged 2 commits into
mainfrom
tests/parsed-source-cache-populate-assert
Jul 2, 2026
Merged

Assert parsed source cache population#3546
koxudaxi merged 2 commits into
mainfrom
tests/parsed-source-cache-populate-assert

Conversation

@koxudaxi

@koxudaxi koxudaxi commented Jul 2, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • Tests
    • Expanded parity coverage for source parsing cache behavior.
    • Added assertions that cached runs populate entries while uncached runs do not, while still verifying output remains unchanged.

@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 623fd2a2-27cb-4ff7-bb51-e48fc14755a2

📥 Commits

Reviewing files that changed from the base of the PR and between 33476e6 and 65e5b15.

📒 Files selected for processing (1)
  • tests/main/test_parsed_source_cache_parity.py

📝 Walkthrough

Walkthrough

The test module for parsed-source cache parity was modified to import the internal cache dictionary and change the helper function to return the count of cache entries instead of None. The main parity test was updated to assert cache-entry counts for cached versus uncached runs.

Changes

Parsed Source Cache Parity Test Update

Layer / File(s) Summary
Cache entry counting and assertions
tests/main/test_parsed_source_cache_parity.py
Imports internal _parser_source_data_cache, changes helper to return cache entry count, adds allow_direct_assert marker, and asserts cached runs populate the cache while uncached runs do not.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ 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 clearly matches the main change: asserting parsed source cache population in the parity test.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch tests/parsed-source-cache-populate-assert

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.

@codspeed-hq

codspeed-hq Bot commented Jul 2, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

✅ 11 untouched benchmarks
⏩ 98 skipped benchmarks1


Comparing tests/parsed-source-cache-populate-assert (65e5b15) with main (33476e6)

Open in CodSpeed

Footnotes

  1. 98 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

📚 Docs Preview: https://pr-3546.datamodel-code-generator.pages.dev

@koxudaxi koxudaxi marked this pull request as ready for review July 2, 2026 16:36
@koxudaxi koxudaxi enabled auto-merge (squash) July 2, 2026 16:36
@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (33476e6) to head (65e5b15).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #3546   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          161       161           
  Lines        34363     34367    +4     
  Branches      4011      4011           
=========================================
+ Hits         34363     34367    +4     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@koxudaxi koxudaxi merged commit f877a58 into main Jul 2, 2026
61 checks passed
@koxudaxi koxudaxi deleted the tests/parsed-source-cache-populate-assert branch July 2, 2026 16:59
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Breaking Change Analysis

Result: No breaking changes detected

Reasoning: The PR only changes a single test file (tests/main/test_parsed_source_cache_parity.py). It imports the internal _parser_source_data_cache for test purposes, changes a test helper's return type, and adds assertions verifying cache behavior. There are no changes to generated code output, Jinja2 templates, CLI options, the public Python API, default values/behavior, supported Python versions, or error handling. The removed lines are limited to test internals. Therefore this contains no user-facing breaking changes.


This analysis was performed by Claude Code Action

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

🎉 Released in 0.67.0

This PR is now available in the latest release. See the release notes for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant