Let's fix PyTest suite for cakephp ex repository - #168
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe PR refactors the CakePHP test harness to support multi-OS testing with version gating. It introduces test constants defining allowed PHP versions per RHEL release (TAGS and is_test_allowed), configures both template tests to skip unsupported OS-version combinations, updates OpenShiftAPI to use a shared cluster, adds a new local template deployment test, refactors the remote test to use PR-based source references instead of version-dependent branch selection, and updates the workflow PR status label to include the OS matrix variable. ChangesCakePHP Test Harness: OS-Version Gating and Template Refactor
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
|
[test] |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
.github/workflows/openshift-tests.yml (1)
13-13: ⚡ Quick winConsider whether PHP 8.1-ubi8 should be included in the test matrix.
The test matrix includes PHP 7.4, 8.2, 8.3, and 8.4, but skips 8.1. Since the default fallback version in
tests/test_cakephp.pyis "8.1-ubi8" and it represents the minimum version for CakePHP 5.X testing (based on the branching logic), consider adding it to ensure comprehensive coverage of the CakePHP 5 compatibility range.🤖 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 @.github/workflows/openshift-tests.yml at line 13, Add "8.1-ubi8" to the version matrix array in the openshift-tests.yml file. This version is currently missing from the test matrix but is defined as the default fallback version in tests/test_cakephp.py and represents the minimum version for CakePHP 5.X testing. Include it in the appropriate position within the version array to ensure comprehensive test coverage of the supported PHP versions.
🤖 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 `@tests/test_cakephp.py`:
- Around line 26-30: The version check in the conditional statement for
branch_to_test and expected_output currently only handles PHP 7.4 and 8.0, but
this causes PHP 8.1 to default to CakePHP 5 which requires PHP 8.2 minimum. Add
"8.1" to the version check condition alongside "7.4" and "8.0" so that PHP 8.1
environments are explicitly routed to use CakePHP 4.X, which supports PHP 8.1.
- Line 16: The OpenShiftAPI constructor call in the test setup is passing an
undocumented shared_cluster=True parameter that is not part of the library's
documented API and will cause issues at runtime. Remove the shared_cluster=True
parameter from the OpenShiftAPI instantiation while keeping the pod_name_prefix
parameter intact, matching the pattern used in similar test classes like
TestCakePHPAppMySQLExTemplate.
---
Nitpick comments:
In @.github/workflows/openshift-tests.yml:
- Line 13: Add "8.1-ubi8" to the version matrix array in the openshift-tests.yml
file. This version is currently missing from the test matrix but is defined as
the default fallback version in tests/test_cakephp.py and represents the minimum
version for CakePHP 5.X testing. Include it in the appropriate position within
the version array to ensure comprehensive test coverage of the supported PHP
versions.
🪄 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: defaults
Review profile: CHILL
Plan: Pro
Run ID: d9111cb9-e334-4dc2-a41e-1feab19a2a5d
📒 Files selected for processing (2)
.github/workflows/openshift-tests.ymltests/test_cakephp.py
5b47a34 to
bafa007
Compare
|
[test] |
Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
bafa007 to
2f297f1
Compare
Summary by CodeRabbit
Chores
Tests