[fix] Handle skipped Selenium tests in Django parallel runner#620
[fix] Handle skipped Selenium tests in Django parallel runner#620czarflix wants to merge 4 commits intoopenwisp:masterfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
📜 Recent review details⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (14)
🧰 Additional context used📓 Path-based instructions (1)**/*.{py,html,txt}📄 CodeRabbit inference engine (Custom checks)
Files:
🧠 Learnings (2)📚 Learning: 2026-03-14T20:44:14.555ZApplied to files:
📚 Learning: 2026-03-14T20:44:14.555ZApplied to files:
🔇 Additional comments (3)
📝 WalkthroughWalkthroughReworks SeleniumTestMixin._setup_and_call skip propagation: when a test is skipped it now extracts skip reasons from result.events if present (for RemoteTestResult), otherwise falls back to iterating result.skipped. If any skip reasons are found it calls original_result.addSkip(self, reason) for each, then calls original_result.stopTest(self) and returns early without further execution. Removed previous behavior that attempted to copy result.events to original_result.events. Sequence Diagram(s)sequenceDiagram
participant Test as SkippedTest
participant Mixin as SeleniumTestMixin
participant Result as Result (RemoteTestResult / TestResult)
participant Orig as original_result
Test->>Mixin: _setup_and_call()
Mixin->>Result: inspect result.events? / result.skipped
alt result.events exists
Result-->>Mixin: events with addSkip reasons
Mixin->>Orig: addSkip(self, reason) [for each event]
else fallback to result.skipped
Result-->>Mixin: iterable skipped entries
Mixin->>Orig: addSkip(self, reason) [for each skipped]
end
Mixin->>Orig: stopTest(self)
Mixin-->>Test: return (early)
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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 |
|
@asmodehn Should I push the changes ? |
|
I pushed the cleanup changes for the agreed review points:
I kept the |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
hi @nemesifier
All Green |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 13978 🏁 Script executed: Length of output: 37 🌐 Web query: 💡 Result: In Django’s parallel test runner, the subprocess uses
|
|
Follow-up pushed. The event-log corruption concern was correct: the skip path was overwriting the shared I removed that overwrite, record |
|
Hi @nemesifier @asmodehn . All changes addressed, please review once you have the time |
|
@nemesifier could you take a look, this addresses the selenium test issue and it unlocks failing CIs of the other issues |
nemesifier
left a comment
There was a problem hiding this comment.
Code looks good but manual testing is needed before confirming and merging.
asmodehn
left a comment
There was a problem hiding this comment.
Looks like a good and clean set of changes with matching test. Thanks !
@nemesifier , please take a look when you have the time |
Checklist
Reference to Existing Issue
Closes #619.
Description of Changes
openwisp-utils#570fixed skipped Selenium tests by propagating skips fromresult.skipped.That works for standard unittest results, but it breaks under Django's parallel test runner because
RemoteTestResult.skippedis a truthyDummyList, which is not iterable. In that case, skip information is recorded inresult.events.This patch keeps the serial skip behavior introduced by
#570and fixes the parallel case by reading skip reasons fromresult.eventswhen available, while falling back toresult.skippedfor standard results.It also adds focused regression coverage for both result types:
TestResultRemoteTestResultVerification
I verified locally with:
./run-qa-checkspython tests/manage.py test test_project.tests.test_selenium_mixintest_project.tests.test_selenium_mixinunder Django4.2,5.0,5.1, and5.2I also checked the behavior around
#570directly:#570, skipped Selenium tests were incorrectly reported as successful#570fixed serial skip propagation but crashes under the parallel result typeScreenshot
N/A