Skip to content

Test add pytests#23

Closed
Snuffy2 wants to merge 7 commits into
Allow-username-changes-and-reconfigurefrom
test-Add-pytests
Closed

Test add pytests#23
Snuffy2 wants to merge 7 commits into
Allow-username-changes-and-reconfigurefrom
test-Add-pytests

Conversation

@Snuffy2

@Snuffy2 Snuffy2 commented May 13, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • Chores

    • Added GitHub Actions workflows for automated testing and coverage reporting on pull requests.
    • Configured pytest and code coverage tooling with enhanced settings.
    • Added test runner script for local testing execution.
  • Tests

    • Added comprehensive test suite covering integration setup, configuration flows, climate controls, sensors, diagnostics, data updates, and resiliency scenarios.

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 13, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (1)
  • dev

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 78e2737b-7c05-45e0-af49-2104f4918e9c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test-Add-pytests

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.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fb306811cf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread custom_components/ha_carrier/config_flow.py Outdated
Comment thread custom_components/ha_carrier/config_flow.py
Snuffy2 added 4 commits May 13, 2026 10:00
Move the review-loop regression tests onto the queued pytest branch.

Cover identityId migration outcomes, v1-to-v3 migration chaining, username updates, duplicate identity handling, and blank-password reuse.
@Snuffy2 Snuffy2 force-pushed the test-Add-pytests branch from a746c09 to 249bf22 Compare May 13, 2026 14:03

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 249bf2269a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/pytest_coverage.yml
Enforce the documented 80 percent coverage target and add focused tests for coordinator, climate, and sensor behavior to keep the suite above that gate.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6c101128aa

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/post_coverage_to_pr.yml
Unload reloaded Carrier config entries in reauth flow tests so Home Assistant does not report lingering coordinator refresh timers during CI teardown.
@github-actions

Copy link
Copy Markdown

Coverage report

This PR does not seem to contain any modification to coverable code.

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

Actionable comments posted: 5

🤖 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 @.github/workflows/post_coverage_to_pr.yml:
- Line 22: Replace the mutable tag reference
"py-cov-action/python-coverage-comment-action@v3" in the workflow step with a
pinned commit SHA; update the uses field in
.github/workflows/post_coverage_to_pr.yml to
"py-cov-action/python-coverage-comment-action@<commit-sha>" (obtain the exact
SHA from the action repo's commit history) so the coverage action is
reproducible and immutable.
- Around line 14-17: Remove the unnecessary high-privilege permission by
deleting the "contents: write" entry from the workflow's permissions block; keep
"pull-requests: write" (needed for posting PR comments) and "actions: read"
intact so the workflow follows least privilege.

In @.github/workflows/pytest_coverage.yml:
- Line 21: The workflow currently references mutable action tags (e.g., "uses:
actions/checkout@v6" and the other uses lines at 24, 41, 49); replace those tag
references with the corresponding full commit SHAs for each action invocation so
the workflow is pinned to exact commits (search for the "uses:" lines such as
actions/checkout@v6, actions/setup-python@v4, actions/upload-artifact@v4 or
similar and swap the `@v`* tag for the action's full SHA from the upstream repo).
- Around line 15-17: The workflow's permissions block grants overly broad write
access by setting contents: write; change the permissions map so that
pull-requests remains write (for commenting) and contents is reduced to read to
follow least-privilege (update the permissions section replacing contents: write
with contents: read), ensuring the permissions keys (permissions, pull-requests,
contents) are preserved and only the contents permission level is lowered.

In `@tests/test_carrier_data_update_coordinator.py`:
- Around line 186-193: Replace the broad pytest.raises(Exception) with a
specific pytest.raises(ConfigEntryAuthFailed) in the test that patches
coordinator._async_full_refresh and calls coordinator._async_update_data; update
imports to include ConfigEntryAuthFailed if missing, and leave the existing
assertions (e.g., assert exc_info.type.__name__ == "ConfigEntryAuthFailed" and
assert coordinator.data_flush is True) intact so the test only catches the
intended authorization failure from coordinator._async_update_data.
🪄 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: ASSERTIVE

Plan: Pro

Run ID: 32ac90ad-81f9-4125-9a16-91b8bd5889a8

📥 Commits

Reviewing files that changed from the base of the PR and between 5500fc2 and d757006.

📒 Files selected for processing (18)
  • .github/workflows/post_coverage_to_pr.yml
  • .github/workflows/pytest_coverage.yml
  • pyproject.toml
  • scripts/test
  • tests/__init__.py
  • tests/conftest.py
  • tests/test_binary_sensor.py
  • tests/test_carrier_data_update_coordinator.py
  • tests/test_carrier_entity.py
  • tests/test_climate.py
  • tests/test_config_flow.py
  • tests/test_diagnostics.py
  • tests/test_init.py
  • tests/test_migrate.py
  • tests/test_resiliency.py
  • tests/test_select.py
  • tests/test_sensor.py
  • tests/test_util.py

Comment thread .github/workflows/post_coverage_to_pr.yml
Comment thread .github/workflows/post_coverage_to_pr.yml
Comment thread .github/workflows/pytest_coverage.yml
Comment thread .github/workflows/pytest_coverage.yml
Comment thread tests/test_carrier_data_update_coordinator.py
@Snuffy2 Snuffy2 closed this May 13, 2026
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.

1 participant