Skip to content

fix(tests): add result_json to Parsed() calls for tox 4.59 compat - #595

Merged
rockygeekz merged 3 commits into
ansible:mainfrom
rockygeekz:fix/compat-tox-4.59-parsed-result-json
Aug 11, 2026
Merged

rockygeekz merged 3 commits into
ansible:mainfrom
rockygeekz:fix/compat-tox-4.59-parsed-result-json

Conversation

@rockygeekz

@rockygeekz rockygeekz commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • tox 4.59.0 (tox-dev/tox#4014) changed State.__init__ in tox/session/state.py to access options.parsed.result_json directly instead of using getattr with a fallback default.
  • This breaks 28 tests in the devel CI that construct Parsed() objects without including result_json, causing AttributeError: 'Parsed' object has no attribute 'result_json'.
  • Adding result_json=None to all Parsed() constructor calls across 3 test files fixes the failures.

Files changed

  • tests/unit/test_downstream_matrix.py (1 call)
  • tests/unit/test_plugin.py (26 calls)
  • tests/unit/test_plugin_molecule.py (11 calls)

Test plan

  • Verify devel CI passes (the 28 previously failing tests should now pass)
  • Verify stable CI still passes (no regression)

Summary by CodeRabbit

  • Tests
    • Updated test fixtures to include the newly required parsed-result state.
    • Preserved existing test behavior and assertions across downstream, plugin, and molecule test coverage.

tox 4.59.0 (tox-dev/tox#4014) changed State.__init__ to access
options.parsed.result_json directly instead of using getattr with
a fallback default. This breaks tests that construct Parsed objects
without including result_json, causing AttributeError in 28 tests.

Adding result_json=None to all Parsed() constructor calls in the
test suite fixes the devel test failures.
@coderabbitai

coderabbitai Bot commented Aug 11, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

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

Next review available in: 40 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

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: 8b6bf5b3-52dc-48cb-895f-8fb1e1c82bd8

📥 Commits

Reviewing files that changed from the base of the PR and between 0f6c9cc and 7cbe988.

📒 Files selected for processing (3)
  • tests/unit/test_downstream_matrix.py
  • tests/unit/test_plugin.py
  • tests/unit/test_plugin_molecule.py
📝 Walkthrough

Walkthrough

The pull request updates unit-test Parsed fixtures to initialize result_json to None across plugin, molecule, and downstream matrix tests.

Changes

Parsed fixture updates

Layer / File(s) Summary
Initialize Parsed test fixtures
tests/unit/test_downstream_matrix.py, tests/unit/test_plugin.py, tests/unit/test_plugin_molecule.py
Existing test state and configuration setup now passes result_json=None when constructing Parsed instances.

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

Suggested reviewers: cidrblock, alisonlhart

🚥 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 and concisely describes the test fixture updates required for tox 4.59 compatibility.
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 unit tests (beta)
  • Create PR with unit tests

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

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
tests/unit/test_downstream_matrix.py (1)

54-54: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Align result_json=None in every multiline Parsed fixture.

The new argument is consistently under-indented at all listed sites. Align it with the other keyword arguments.

  • tests/unit/test_downstream_matrix.py#L54-L54: indent result_json=None by eight spaces.
  • tests/unit/test_plugin.py#L964-L964: indent result_json=None by eight spaces.
  • tests/unit/test_plugin.py#L1026-L1026: indent result_json=None by eight spaces.
  • tests/unit/test_plugin.py#L1083-L1083: indent result_json=None by eight spaces.
  • tests/unit/test_plugin.py#L1170-L1170: indent result_json=None by eight spaces.
  • tests/unit/test_plugin.py#L1222-L1222: indent result_json=None by eight spaces.
  • tests/unit/test_plugin.py#L1343-L1343: indent result_json=None by eight spaces.
  • tests/unit/test_plugin_molecule.py#L382-L382: indent result_json=None by eight spaces.
  • tests/unit/test_plugin_molecule.py#L426-L426: indent result_json=None by eight spaces.
  • tests/unit/test_plugin_molecule.py#L471-L471: indent result_json=None by eight spaces.
  • tests/unit/test_plugin_molecule.py#L515-L515: indent result_json=None by eight spaces.
  • tests/unit/test_plugin_molecule.py#L558-L558: indent result_json=None by eight spaces.
  • tests/unit/test_plugin_molecule.py#L619-L619: indent result_json=None by eight spaces.
  • tests/unit/test_plugin_molecule.py#L666-L666: indent result_json=None by eight spaces.
  • tests/unit/test_plugin_molecule.py#L740-L740: indent result_json=None by eight spaces.

As per path instructions, this review prioritizes readability and maintainability.

🤖 Prompt for 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.

In `@tests/unit/test_downstream_matrix.py` at line 54, Align the result_json=None
argument with the other keyword arguments in every multiline Parsed fixture:
tests/unit/test_downstream_matrix.py lines 54-54; tests/unit/test_plugin.py
lines 964-964, 1026-1026, 1083-1083, 1170-1170, 1222-1222, and 1343-1343; and
tests/unit/test_plugin_molecule.py lines 382-382, 426-426, 471-471, 515-515,
558-558, 619-619, 666-666, and 740-740. Indent each occurrence by eight spaces
without changing fixture behavior.

Source: Path instructions

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

Nitpick comments:
In `@tests/unit/test_downstream_matrix.py`:
- Line 54: Align the result_json=None argument with the other keyword arguments
in every multiline Parsed fixture: tests/unit/test_downstream_matrix.py lines
54-54; tests/unit/test_plugin.py lines 964-964, 1026-1026, 1083-1083, 1170-1170,
1222-1222, and 1343-1343; and tests/unit/test_plugin_molecule.py lines 382-382,
426-426, 471-471, 515-515, 558-558, 619-619, 666-666, and 740-740. Indent each
occurrence by eight spaces without changing fixture behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 653ed61f-ac37-4ed5-9c08-f738bc844097

📥 Commits

Reviewing files that changed from the base of the PR and between 96b80c4 and 0f6c9cc.

📒 Files selected for processing (3)
  • tests/unit/test_downstream_matrix.py
  • tests/unit/test_plugin.py
  • tests/unit/test_plugin_molecule.py

Replace 26 verbose multi-line Parsed() calls with a compact _parsed()
helper that sets default override=[] and result_json=None. Brings
the module from 1644 lines back under the 1600 pylint limit.
@rockygeekz
rockygeekz merged commit aa1af79 into ansible:main Aug 11, 2026
54 checks passed
@rockygeekz
rockygeekz deleted the fix/compat-tox-4.59-parsed-result-json branch August 11, 2026 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants