Skip to content

declare proxy features as a fixture#515

Merged
evgeni merged 1 commit into
masterfrom
fixture-features
May 20, 2026
Merged

declare proxy features as a fixture#515
evgeni merged 1 commit into
masterfrom
fixture-features

Conversation

@evgeni
Copy link
Copy Markdown
Member

@evgeni evgeni commented May 20, 2026

Why are you introducing these changes? (Problem description, related links)

I like fixtures

What are the changes introduced in this pull request?

  • use fixtures

How to test this pull request

Steps to reproduce:

  • let the tests run

Checklist

  • Tests added/updated (if applicable)
  • Documentation updated (if applicable)

this allows to cache the result and makes re-using the data easier
@arvind4501
Copy link
Copy Markdown
Contributor

lets see what coderabbit thinks @coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 20, 2026

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Get PR details and diff
gh pr view 515 --repo theforeman/foremanctl
echo "---DIFF---"
gh pr diff 515 --repo theforeman/foremanctl

Length of output: 2215


🏁 Script executed:

#!/bin/bash
# View the full test file to check imports
cat tests/foreman_proxy_test.py

echo "---SEARCH OTHER CALLERS---"
# Check if get_proxy_v2_features is referenced anywhere else
rg "get_proxy_v2_features" --type py -n

Length of output: 2603


🏁 Script executed:

#!/bin/bash
# Find fixture definitions for server, certificates, server_fqdn
rg "`@pytest.fixture`" --type py -n -A 2

Length of output: 8230


This is a clean and well-executed refactor. Here's a summary of what was verified:

✅ No issues found

Check Result
import pytest present ✅ Already on line 4
Dependent fixtures (server, certificates, server_fqdn) have compatible scope ✅ All are scope="module" in conftest.py
No remaining callers of the old get_proxy_v2_features function ✅ Fully replaced
Pattern consistent with existing codebase ✅ Mirrors pulp_status_curl in pulp_test.py and foreman_status_curl in foreman_test.py

Bonus benefit: Because proxy_v2_features is now scope="module", the curl call to /v2/features is made only once for the entire module instead of once per test function — a nice performance improvement for the test suite.

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 20, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c8fa0c2d-1a24-4e11-9b94-01f7792ae6b4

📥 Commits

Reviewing files that changed from the base of the PR and between 920639e and 1812e7f.

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

Walkthrough

This PR refactors BMC-related tests in tests/foreman_proxy_test.py by converting a helper function pattern to a pytest fixture pattern. The new module-scoped proxy_v2_features fixture queries https://{server_fqdn}:{FOREMAN_PROXY_PORT}/v2/features with server certificates and returns parsed JSON. Two test functions, test_bmc_capabilities and test_bmc_default_provider, now receive the fixture as a parameter instead of calling the removed get_proxy_v2_features helper, maintaining identical assertion logic.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • theforeman/foremanctl#514: Directly related; introduces or extends the /v2/features endpoint assertion for bmc_default_provider that this PR builds upon with the fixture pattern.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: converting proxy features retrieval into a pytest fixture instead of a helper function.
Description check ✅ Passed The description is related to the changeset, explaining the preference for fixtures and the intent to use fixtures, though lacking substantial technical detail.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 fixture-features

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 and usage tips.

@arvind4501
Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

great, thanks

@evgeni evgeni merged commit 8561643 into master May 20, 2026
14 checks passed
@evgeni evgeni deleted the fixture-features branch May 20, 2026 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants