Tests for device config updates on org variable changes#1172
Tests for device config updates on org variable changes#1172ssmadhavan006 wants to merge 2 commits intoopenwisp:masterfrom
Conversation
bcc1026 to
e7f3bcb
Compare
|
@coderabbitai review Sorry @ssmadhavan006 we've been flooded with PRs lately and it's taking time to respond to everyone. Instead of sharing screenshots in this case a video recording demonstrating the solution would have been better. |
|
✅ Actions performedReview triggered.
|
WalkthroughThis pull request adds a new test class Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Important Action Needed: IP Allowlist UpdateIf your organization protects your Git platform with IP whitelisting, please add the new CodeRabbit IP address to your allowlist:
Failure to add the new IP will result in interrupted reviews. 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 |
nemesifier
left a comment
There was a problem hiding this comment.
I only see a test here, but no solution, is this on purpose? Waiting for the CI build, I assume you worked on replicating the bug in the tests and I expect this test to fail, let's see.
3388fb1 to
eadb134
Compare
|
Apologies for the noise |
Checklist
Reference to Existing Issue
Closes #1070.
Description of Changes
This PR adds missing automated tests to ensure device configuration status updates correctly when organization configuration variables (context) change. The existing implementation already handled this logic correctly (via checksum comparison) but there was no automated test coverage verifying the behavior.
What’s Added
A new test class
TestOrganizationConfigUpdatesinopenwisp_controller/config/tests/test_device.py. It includes three scenarios:Affected device becomes
modified{{ ssid }}Unaffected device remains
appliedNo status change when checksum does not change
Notes:
Screenshot
Creating a Organization

Creating a Template-1


Creating a Template-2


Device-1 Configuration

Device-2 Configuration

Before Change

Change Org Variable

Device Status Change
