-
Notifications
You must be signed in to change notification settings - Fork 2
Revert custom component testing in favor for (also) testing against dev #266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThis update restructures CI workflows, enhances and consolidates linting and testing configurations, and refactors scripts for better maintainability and feedback. Several setup and test scripts are removed or replaced by a unified approach. Import paths in tests are updated, and project metadata is expanded. Minor formatting improvements are made in component code. Changes
Sequence Diagram(s)sequenceDiagram
participant GitHub as GitHub Actions
participant Cache as Cache Job
participant Prepare as Prepare Job
participant Release as HA-Core Release Job
participant Script as core-testing.sh
GitHub->>Cache: Trigger on PR events
Cache-->>Prepare: Provide cache key/env
Prepare-->>Release: Python env & pre-commit setup
Release->>Script: Run core-testing.sh
Script->>Release: Test results & status
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 Pylint (3.3.7)custom_components/plugwise_usb/__init__.pytests/components/plugwise_usb/conftest.pytests/components/plugwise_usb/test_config_flow.py📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (13)
💤 Files with no reviewable changes (5)
🚧 Files skipped from review as they are similar to previous changes (8)
⏰ Context from checks skipped due to timeout of 90000ms (1)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 5
🧹 Nitpick comments (8)
pyproject.toml (2)
30-31: Consider refining the Homepage URL
The “Homepage” entry points to the organization root. It may be clearer to link directly to this repository instead of the generic org page.
34-35: Keep the update notice in sync
The comment reminds contributors to port pylintinioptions. Ensure it remains accurate when modifying this section in the future.CHANGELOG.md (1)
5-7: Replace “Ongoing” with “Unreleased”
Adopting a standard “## [Unreleased]” section can improve clarity and align with common changelog conventions.requirements_test.txt (1)
6-6: Pin direct-URL dependency carefully
Theplugwise-usbURL is hard-pinned to 0.44.1. Ensure this is updated whenever the package version inmanifest.jsonorpyproject.tomlchanges.scripts/core-testing.sh (4)
10-12: Fix spelling in comment
betweeh→betweenin the repository-name comment to maintain professionalism.
48-50: Consider usingcommand -voverwhich
command -v gitandcommand -v jqare more portable thanwhich.
52-54: Update outdated comment
The reference topython-plugwiseis no longer accurate; adjust to describe the venv seed purpose for HA-core testing.
66-68: Remove redundantset -e
set -eis already in effect at the top of the script. Duplicate invocations can be removed.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (14)
.github/actions/restore-venv/action.yml(1 hunks).github/workflows/test.yml(2 hunks).pre-commit-config.yaml(0 hunks)CHANGELOG.md(1 hunks)custom_components/plugwise_usb/__init__.py(4 hunks)pyproject.toml(2 hunks)requirements_test.txt(1 hunks)scripts/core-testing.sh(7 hunks)scripts/python-venv.sh(0 hunks)scripts/setup.sh(0 hunks)scripts/setup_test.sh(0 hunks)scripts/tests_and_coverage.sh(0 hunks)tests/components/plugwise_usb/conftest.py(2 hunks)tests/components/plugwise_usb/test_config_flow.py(1 hunks)
💤 Files with no reviewable changes (5)
- scripts/tests_and_coverage.sh
- scripts/setup.sh
- scripts/python-venv.sh
- scripts/setup_test.sh
- .pre-commit-config.yaml
🔇 Additional comments (31)
pyproject.toml (6)
22-25: Review classifiers update
Classifiers correctly specify Python 3.13, OS independence, and Topic “Home Automation,” matching the project’s scope.
42-51: Verify the Pylint init-hook path resolution
The init-hook dynamically locates default config files and appends apylint/pluginsdirectory. Confirm this resolves as expected in CI and local environments.
53-64: Pylint plugins loading
Loading Home Assistant–specific pylint plugins alongside core extensions makes sense. No collisions detected with Ruff’s linting scope.
67-73: Extension package allow-list
The list covers key native extensions. Double-check that this list is complete and up-to-date against your dependencies.
74-75:fail-onset to"I"
Failing on all informational messages (I) may be too strict. Verify this is intentional and doesn’t block routine development.
377-384: Pytest configuration
Test paths, logging format, and asyncio settings align with CI requirements. Asyncio “auto” mode should work—confirm no test regressions occurred.tests/components/plugwise_usb/test_config_flow.py (1)
7-14: Imports updated for new integration path
Switching imports tohomeassistant.components.plugwise_usbandtests.common.MockConfigEntryaligns with the refactored namespace. Import order also respects our isort settings.tests/components/plugwise_usb/conftest.py (5)
9-9: Approve library exception import
ImportingStickErrordirectly from theplugwise_usbpackage ensures tests mock the correct underlying exception type.
12-12: Approve updated HA import path
Switching tohomeassistant.components.plugwise_usbaligns with the integration’s new namespace in HA core.
15-15: Approve test utility import
Usingtests.common.MockConfigEntryis correct now that the pytest-homeassistant-custom-component dependency has been removed.
18-18: Approve mock target string update
UpdatingSTICK_IMPORT_MOCKto"homeassistant.components.plugwise_usb.config_flow.Stick"matches the relocated config flow module.
24-28: Verify patched setup entry path
The fixture now patcheshomeassistant.components.plugwise_usb.async_setup_entry. Confirm there are no remaining calls to the old custom_components path.custom_components/plugwise_usb/__init__.py (4)
7-10: Approve import reordering
Grouping third-partyplugwise_usbimports above Home Assistant imports follows PEP8 and improves readability.
55-60: Approve Stick instantiation cleanup
Removing the trailing type-ignore comment has no functional impact and keeps the code clean.
152-156: Approve service registration formatting
Reformatting thedisable_productionservice registration to multi-line enhances clarity without altering behavior.
206-210: Approve consolidated logging calls
Converting the multi-line logger calls inasync_remove_config_entry_deviceto single-line is purely stylistic and retains full context..github/workflows/test.yml (7)
7-10: Approve new environment variables
AddingCACHE_VERSION,PRE_COMMIT_HOME, andVENVsupports the new restore-venv action and pre-commit caching.
12-19: Approve trigger documentation comments
Documenting the rationale for disablingpushandworkflow_dispatchimproves maintainability.
21-27: Approve pull_request triggers
Restricting the workflow to PR events (opened,synchronize,labeled,unlabeled) aligns with label-based CI gating.
29-35: Approve cache job setup
The newcachejob correctly computes a key based on OS, Python version, and file hashes for efficient venv reuse.
61-69: Approve restore-venv integration in prepare job
Using the custom.github/actions/restore-venvaction here cleanly handles environment setup and cache restoration.
85-92: Approve restore-venv in ha-core-release job
Mirroring the cache reuse logic across both jobs ensures consistent setup for HA-core tests.
96-100: Approve core-testing invocation
Runningscripts/core-testing.shwithGITHUB_ACTIONS=""and capturing the exit code is the correct pattern for this consolidated test script.scripts/core-testing.sh (8)
4-9: Approve color code definitions
DefiningCNORM,CFAIL,CINFO, andCWARNat the top enhances output readability.
25-25: Approve branch echo
Echoing the selected HA-core branch with color is a clear and useful diagnostic.
43-43: Approvepip_packageslist
Centralizing required test deps inpip_packagesremains a valid approach for selective module installation.
46-46: Approve preparatory echo
Printing a setup message with color cues helps trace the process in CI logs.
69-77: Approve venv bootstrap block
The in-script venv creation and activation logic imported from HA-core is well structured.
79-82: Approveuvinstallation fallback
Ensuringuvis present before using it maintains compatibility.
84-89: Approve pre-commit setup
Installing and enabling the pre-commit hook at runtime supports local development workflows.
91-91: Approveset +uusage
Disabling undefined-variable errors here is necessary for optional script arguments.
|
@coderabbitai summary |
|
Tip For best results, initiate chat on the files or code changes. @CoMPaTech, here's the summary and review you requested: SummaryThis PR represents a comprehensive refactoring that reverts from custom component testing to testing against Home Assistant core, enabling testing against both stable and development releases. The key changes include: 🔄 CI/CD Restructuring:
🧹 Script Consolidation:
⚙️ Configuration Overhaul:
📦 Namespace Alignment:
Review✅ Strengths:
🔍 Technical Implementation:
This refactoring successfully achieves its objective of enabling dual testing against HA releases while modernizing the development workflow. The implementation quality is high and the changes appear production-ready. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🧹 Nitpick comments (14)
.github/workflows/test.yml (3)
12-12: Clarify trigger comment
The note about disablingpushandworkflow_dispatchtriggers is useful. Consider documenting how to manually invoke the workflow (e.g., viagh workflow run) or adding a README section.
29-34: Pin action versions for stability
Using floating tags likeactions/checkout@v4andactions/setup-python@v5will automatically pick up minor/patch updates. To avoid unexpected breakages, consider pinning to a specific minor version (e.g.,@v4.6.0).
63-68: Consolidate HA-core setup invocation
You invokecore-testing.shtwice: once viarun-commandinrestore-venvand again in a separate step withGITHUB_ACTIONS="" scripts/core-testing.sh. This duplicates setup logic. Consider a single, explicit call to the script to streamline the job.Also applies to: 81-86
scripts/core-testing.sh (11)
4-11: Fix typo in REPO_NAME comment
Line 10 comment reads “betweeh” and is missing a closing parenthesis. Update to:# Repository name (for reuse between plugwise network and usb)
4-9: Improve terminal color handling
Hardcoded ANSI codes can break in non-TTY environments. Consider detecting color support (tput) or provide a--no-colorflag to disable escapes when piping/logging.
25-25: Quote branch echo for safety
On line 25 you doecho -e "${CINFO}Working on HA-core branch ${core_branch}${CNORM}". Wrap${core_branch}in quotes to avoid word splitting if it ever contains spaces.
43-43: Manage pip_packages dynamically
Thepip_packagesregex is hardcoded. This can drift fromrequirements_test_all.txt. Consider deriving this list programmatically from the component’s manifest or a config file.
46-51: Add checks for Python and pip
You verifygitandjq, but the script also assumespython3andpip/uv. Add tools checks (which python3,which pip3) to fail early if Python isn’t installed.
85-89: Pin pre-commit version
uv pip install --upgrade pre-commitmay pull a breaking release. Pin to a tested version viarequirements_test.txtor specify it in this command.
99-101: Improve argument parsing
Parsing$1/$2with manual checks is brittle. Consider usinggetoptsor a case statement for clear handling ofcore_prep,pip_prep,testing, andqualitymodes.
183-185: Use official bootstrap script directly
Parsingscript/bootstrapviagrep | sedis brittle. Invokescript/bootstrapwith a--no-devor--depsflag directly if available, or centralize bootstrap arguments.
188-196: Quote rm and cp paths
Lines removing and copying component directories should quote paths to safely handle special characters or spaces:rm -rf "homeassistant/components/${REPO_NAME}" "tests/components/${REPO_NAME}" cp -r "../custom_components/${REPO_NAME}" "./homeassistant/components/"
212-224: Streamline pip installs
You run multipleuv pip installcommands for extras, basics, and module. Combine into a singlepip install -ror use a constraints file to speed up setup and reduce redundancy.Also applies to: 229-231
238-249: Simplify pytest invocation
Instead of manually capturingEXIT_CODEand re-exiting, rely onset -eto fail fast on test errors. Removeset +eand explicitexit $EXIT_CODEfor clarity.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.github/workflows/test.yml(1 hunks)scripts/core-testing.sh(9 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Setup for HA-core (release/master)
🔇 Additional comments (6)
.github/workflows/test.yml (4)
7-10: Ensure VENV and PRE_COMMIT_HOME align with scripts
You’ve addedCACHE_VERSION,PRE_COMMIT_HOME, andVENVenv vars for caching and venv layout. Confirm these values (venv,~/.cache/pre-commit) exactly match the expectations inprepare-python-and-codeand incore-testing.sh.
21-26: Review removal of manual and scheduled triggers
Restricting topull_requestevents (opened,synchronize,labeled,unlabeled) removes ability to run on push or via dispatch. Ensure this matches your team’s needs, or re-enableworkflow_dispatch/scheduleif manual or nightly runs are required.
37-45: Validate cache key inputs
The cache key hashespyproject.toml,requirements_test.txt, and.pre-commit-config.yaml. Since dependencies now live inpyproject.toml, ensurerequirements_test.txtand the pre-commit config still exist and drive the cache. Update if paths or filenames changed.
49-55: Confirm inputs for prepare-python-and-code action
Theplugwise/gh-actions/prepare-python-and-code@v1action receivescache-key,fail-on-miss,python-version,venv-dir, andprecommit-home. Validate that these map correctly to the action’s inputs after your refactoring.scripts/core-testing.sh (2)
255-273: Document skipped linters
You skippylintandmypy(lines 265 & 268). If intentional, add comments explaining why (e.g., awaiting core-level support). Otherwise, re-enable them to catch issues early.
279-295: Verify local vs CI paths
The block underif [ -z "${GITHUB_ACTIONS}" ]copies files back and runshassfest. Make sure local dev workflows still function as expected; consider a--localflag or document this behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
♻️ Duplicate comments (4)
scripts/core-testing.sh (4)
67-77: DRY up virtualenv setup
You still have duplicated venv creation logic here and later at lines 169–177. Extract into a function (e.g.,ensure_venv) to centralize and reduce repetition.
164-164: Avoid writing into .git directory
Writing${REPO_NAME}-trackinginside.git/still persists here. As flagged earlier, move tracking files to a separate directory (e.g.,.ha_tracking/) outside of Git metadata.
169-177: DRY up virtualenv setup (duplicate)
This block duplicates the environment setup at lines 67–77. Consolidate into oneensure_venvfunction.
179-181: DRY up uv installation (duplicate)
This UV presence check is redundant given the block at lines 79–82. Merge these checks in one place.
🧹 Nitpick comments (4)
.github/workflows/test.yml (1)
29-32: Refine cache job naming
The job name “Cache identify” is a bit misleading. Consider renaming to something like “Determine cache key” for clarity:- name: Cache identify + name: Determine cache keyscripts/core-testing.sh (3)
10-12: Fix typo in repository comment
Correct the misspelling “betweeh” and close the parenthesis:- # Repository name (for reuse betweeh plugwise network and usb + # Repository name (for reuse between plugwise network and usb)
79-82: DRY up uv installation
Similar UV installation logic appears twice (here and lines 179–181). Consolidate into a reusable function after extracting the venv logic.
188-195: Simplify component cleanup
Instead ofrm -r ... || echo, consider usingrm -rfto remove without errors:- rm -r homeassistant/components/${REPO_NAME} tests/components/${REPO_NAME} || echo -e "${CWARN}already clean${CNORM}" + rm -rf homeassistant/components/${REPO_NAME} tests/components/${REPO_NAME}
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.github/workflows/test.yml(1 hunks)scripts/core-testing.sh(8 hunks)
🔇 Additional comments (29)
.github/workflows/test.yml (11)
7-10: Validate DEFAULT_PYTHON version compatibility
You’re pinning DEFAULT_PYTHON to “3.13”. Please confirm thatactions/setup-python@v5(and any downstream dependencies) fully supports Python 3.13 today.
12-19: Skip: Informational comment on trigger disabling
These commented suggestions for handling PR labels don’t need changes in this PR.
21-27: Approved pull_request-only triggers
Restricting to pull_request events aligns with the new testing workflow.
37-40: Approved action version updates
Usingactions/checkout@v4andactions/setup-python@v5is up-to-date and appropriate.
47-50: Cache preparation configuration looks good
Restoring the environment in a separatepreparejob withfail-on-miss: falseis smart.
53-59: Approved usage of prepare-python-and-code action
Parameterization withcache-key,venv-dir, andclone-coreis clear and maintainable.
62-62: Approved clone-core flag
Explicitly enablingclone-core: "true"ensures we fetch the HA core.
64-66: Approved ha-core-release job definition
Splitting outha-core-releasewith explicit dependencies is clear.
69-71: Approved job dependencies
Chainingha-core-releaseon bothcacheandprepareis correct.
75-82: Approved cache restoration
Leveragingplugwise/gh-actions/restore-venv@v1with pinned versions and inputs is consistent.
85-88: Skip: core-testing.sh invocation
Theset +ecombined with manual exit code propagation is intentional for better error reporting.scripts/core-testing.sh (18)
4-9: Skip: Color definitions
ANSI color codes are valid and improve readability.
25-25: Skip: Branch info echo
The informational message correctly reflectscore_branch.
43-43: Skip: pip_packages list
The list of test dependencies appears comprehensive.
46-51: Skip: Tool presence checks
Verifyinggitandjqupfront is appropriate.
114-121: Skip: Core reset logs
The colored logging for resetting and rebasing HA core is clear.
183-186: Skip: HA-core bootstrap pip
Using HA-core’s bootstrap script pip extraction is valid.
203-209: Skip: Translation setup
Runningscript.translationsquietly is fine.
212-223: Skip: Pip modules installation
The staged installation of HA requirements and extras looks correct.
226-231: Skip: Manifest dependency install
Extracting and installing the required module frommanifest.jsonviajqis concise.
238-244: Skip: Test commencement log
The debug parameter injection is clear and functional.
249-249: Skip: Pytest invocation
The pytest command with coverage and snapshot flags is appropriate.
255-263: Skip: Ruff autofix steps
Runningruff --fixon both component and tests is a good balance of automation and permission to overwrite.
265-271: Skip: Skipping pylint and mypy
Explicitly disabling these is intentional to speed up CI.
272-273: Skip: Markdown linting
Running markdownlint via pre-commit is fine.
281-286: Skip: Copy-back and manifest cleanup
This section only runs outside GitHub Actions; the logic is sound.
293-299: Skip: Hassfest requirement patching
Thejqandsedoperations for manifest adjustments are correct.
303-305: Skip: Hassfest validation
Runningscript.hassfestin GH Actions covers core validation.
314-320: Skip: Local commit-check block
The pre-commit gating for local runs is intentional for developer workflow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
♻️ Duplicate comments (1)
.github/workflows/test.yml (1)
37-49: Remove outdated file from cache key
You’re still hashing.pre-commit-config.yamlin your cache key, but that file was removed in this PR. Please update thehashFiles()call to only include existing files.
🧹 Nitpick comments (3)
.github/workflows/test.yml (3)
12-18: Remove or relocate commented workaround
The block of commented-out curl steps clutters the workflow. If it’s no longer needed, remove it; otherwise, document it in a maintenance guide or README.
29-35: Consider clarifying cache job name
The job key iscachewith a step name "Cache identify". For readability, you might rename the job or step to "Determine cache key" to better communicate its intent.
94-100: Pin ShellCheck action to a stable version
Usingludeeus/action-shellcheck@masterrisks breaking the build if the action’s default branch changes. Pin to a specific release tag or SHA for reproducibility.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.github/workflows/test.yml(1 hunks).pre-commit-config.yaml(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- .pre-commit-config.yaml
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Setup for HA-core (release/master)
🔇 Additional comments (5)
.github/workflows/test.yml (5)
4-4: Workflow name is clear
Naming the workflow as "Test against HA-core" accurately reflects its purpose.
7-10: Validate environment variables against HA requirements
Ensure thatDEFAULT_PYTHON(3.13) aligns with the Home Assistant versions you intend to test, and thatPRE_COMMIT_HOMEandVENVpaths are correct across all runners.
21-26: Restricting triggers to PR events is intentional
Limiting the workflow to specific pull request types (opened,synchronize,labeled,unlabeled) matches the desired behavior. No concerns here.
50-66: Prepare job setup looks good
Usingplugwise/gh-actions/prepare-python-and-code@v1withfail-on-miss: falseelegantly handles cache misses. The inputs are clear.
68-92: Clarify the GITHUB_ACTIONS workaround
The lineGITHUB_ACTIONS="" scripts/core-testing.shworks around GH Actions detection, but it would help future maintainers to add a brief comment explaining why this is necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
♻️ Duplicate comments (3)
.github/workflows/test.yml (1)
46-49: Remove stale pre-commit config from cache key
You’re hashing.pre-commit-config.yamlwhich was removed in this PR, breaking the cache key computation.Apply this diff:
- run: echo "cache-key=${{ runner.os }}-venv-cache-${{ env.CACHE_VERSION }}-${{ steps.python.outputs.python-version }}-${{ hashFiles('pyproject.toml', 'requirements_test.txt', '.pre-commit-config.yaml', 'ha_pyproject.toml') }}" >> "$GITHUB_OUTPUT" + run: echo "cache-key=${{ runner.os }}-venv-cache-${{ env.CACHE_VERSION }}-${{ steps.python.outputs.python-version }}-${{ hashFiles('pyproject.toml', 'requirements_test.txt', 'ha_pyproject.toml') }}" >> "$GITHUB_OUTPUT"pyproject.toml (1)
387-389: Coverage source mismatch with package directory
The[tool.coverage.run]source is set to"plugwise_usb-beta", but your package directory isplugwise_usb, so coverage won’t be collected.Apply this diff:
- source = ["plugwise_usb-beta"] + source = ["plugwise_usb"]scripts/core-testing.sh (1)
164-165: Avoid writing into.gitdirectory
Writing tracking files under.git/can corrupt Git metadata and will be ignored. Store trackers in a separate directory, for example.ha_tracking, outside of.git.- git log -1 | head -1 > "${coredir}/.git/${REPO_NAME}-tracking" + mkdir -p "${coredir}/.ha_tracking" + git log -1 | head -1 > "${coredir}/.ha_tracking/${REPO_NAME}-tracking"
🧹 Nitpick comments (2)
scripts/core-testing.sh (2)
10-11: Fix typo in comment
There's a typo in the repository name comment (betweeh→between).- # Repository name (for reuse betweeh plugwise network and usb + # Repository name (for reuse between Plugwise network and USB)
67-77: DRY up virtual environment setup
The venv creation and activation logic is duplicated in two places. Extract it into a function (e.g.,ensure_venv) to centralize and reduce code duplication.Also applies to: 168-176
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (13)
.github/workflows/test.yml(1 hunks).pre-commit-config.yaml(1 hunks)CHANGELOG.md(1 hunks)custom_components/plugwise_usb/__init__.py(4 hunks)pyproject.toml(2 hunks)requirements_test.txt(1 hunks)scripts/core-testing.sh(8 hunks)scripts/python-venv.sh(0 hunks)scripts/setup.sh(0 hunks)scripts/setup_test.sh(0 hunks)scripts/tests_and_coverage.sh(0 hunks)tests/components/plugwise_usb/conftest.py(2 hunks)tests/components/plugwise_usb/test_config_flow.py(1 hunks)
💤 Files with no reviewable changes (4)
- scripts/setup.sh
- scripts/tests_and_coverage.sh
- scripts/setup_test.sh
- scripts/python-venv.sh
✅ Files skipped from review due to trivial changes (1)
- CHANGELOG.md
🚧 Files skipped from review as they are similar to previous changes (5)
- requirements_test.txt
- tests/components/plugwise_usb/test_config_flow.py
- .pre-commit-config.yaml
- tests/components/plugwise_usb/conftest.py
- custom_components/plugwise_usb/init.py
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Prepare
bouwew
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like it's working well when testing locally, nice job @CoMPaTech !
|
ArnoutD
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the current way of announced breaking changes and the fact that the dev version might break instead of apply'ing to the beta's which are coming through in pytest-homeassistant-custom-component the added amount of boiler plate is not worth the trouble. Testing is a lot easier and faster using the package and the required local disc space for development is smaller.
but I am still going to approve the change
|
Duly noted @ArnoutD - as discussed on discord I'll follow-up with a split CI and pre-commit suggestion reinstating pytest custom component |



Summary by CodeRabbit
Chores
Refactor
Style