-
Notifications
You must be signed in to change notification settings - Fork 4
Add test for alarm timestamp differences between active and inactive states #606
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
base: main
Are you sure you want to change the base?
Conversation
…states Co-authored-by: emiltin <[email protected]>
emiltin
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.
@copilot please see my review, we need to consider different core versions
spec/site/tlc/alarm_spec.rb
Outdated
|
|
||
| # Validate that alarm timestamps are different when alarm turns active vs inactive. | ||
| # | ||
| # This test verifies RSMP 3.1.4 behavior where the alarm timestamp (aTs) |
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.
if this behaviour differs between core versions, we need to tag the test with the appropriate core version, and maybe have more than one test
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.
Added core version tagging in commit 5c2bfbd:
- RSMP 3.1.4+: Test tagged with
core: '>=3.1.4'- verifies timestamps differ between active/inactive states (new behavior) - Pre-3.1.4: Added separate test with
core: '<3.1.4'- verifies both states received without requiring different timestamps (legacy behavior)
The tests now properly handle the core version differences where alarm timestamp behavior changed in RSMP 3.1.4.
Co-authored-by: emiltin <[email protected]>
I've addressed the core version requirements in commit 5c2bfbd. The test now has proper core version tagging:
This ensures tests run appropriately based on the RSMP core version being tested. |
|
@copilot to focus, let's remove checks that timestamps are close to now. in the core >= 3.1.4 test, instead of checking that timestamps a!=b && a>b, we cna just to a>b, so remove the check that they differ. We don't need log("Testing alarm #{alarm_code_id} timestamp behavior in pre-3.1.4 versions"), as this is described by the test name and tags, and will already to logged automatically. Also remove 'success' logging like log("Verified alarm #{alarm_code_id} has different timestamps: Active=#{active_timestamp}, Inactive=#{inactive_timestamp}") |
…ersion terminology, remove timing checks, simplify assertions Co-authored-by: emiltin <[email protected]>
Updated the tests in commit 0c2c1dc based on your feedback:
|
Working on issue #16: Add test to check alarm timestamp when it turns inactive ✅
Completed:
spec/site/tlc/alarm_spec.rbwith_alarm_activatedhelper method usage patterncore: '>=3.1.4'for the new behaviorSummary:
Added comprehensive test coverage for alarm timestamp behavior across RSMP core versions:
For RSMP core >= 3.1.4 (
core: '>=3.1.4'):'A0302 has different timestamps for active and inactive states'For RSMP core < 3.1.4 (
core: '<3.1.4'):'A0302 alarm timestamps in RSMP core < 3.1.4 versions'Refinements based on feedback:
The implementation properly handles the core version differences as requested in the review feedback, ensuring tests run appropriately based on the RSMP core version being tested.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.