-
Notifications
You must be signed in to change notification settings - Fork 328
NEW: Test case for monotonic timestamps. #2262
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: develop
Are you sure you want to change the base?
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
🤖 Helpful? Please react with 👍/👎 | Questions❓Please reach out in Slack #ask-u-pr-agent |
PR Code Suggestions ✨No code suggestions found for the PR. |
Codecov ReportAll modified and coverable lines are covered by tests ✅ @@ Coverage Diff @@
## develop #2262 +/- ##
===========================================
+ Coverage 76.70% 76.81% +0.10%
===========================================
Files 465 476 +11
Lines 87919 88659 +740
===========================================
+ Hits 67442 68101 +659
- Misses 20477 20558 +81 Flags with carried forward coverage won't be shown. Click here to find out more.
... and 25 files with indirect coverage changes 🚀 New features to boost your workflow:
|
|
This currently fails for Android due to package containing Android specific path which ignores timestamps. |
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.
Thanks for adding this, makes a lot of sense to have this.
How should we proceed with regards to Android CI errors? I'm fine approving once CI is green
| // Accepted: equal | ||
| InputSystem.QueueStateEvent(device, new KeyboardState(Key.Space), 1.0); | ||
| InputSystem.Update(); | ||
| Assert.That(device.spaceKey.ReadValue(), NUnit.Framework.Is.EqualTo(1.0f).Within(1e-6)); |
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'm wondering why we don't use the already defined using Is = UnityEngine.TestTools.Constraints.Is that we use a lot across all codebase tests?
The same applies to other NUnit.Framework.Is.Equal calls below.
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.
Will probably switch to UnityEngine.TestTools.Constraints.Is but it's just terribly annoying to have hundreds of code warnings inside the file leading to the quick navigation in scrollbar being unusable due to all warnings. The above Is extends the class I used and that generates a warning, e.g. "you should not access static functions via derived class", which makes sense. But maybe we should just add the required pragmas to the test classes to see actual warnings and fix them if this noise is removed.
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 create a separate PR to fix these messy using/aliasing.
Good question, I want to sync up with Android team how they decide to land and backport the pending PR first. Then we either need to add an exception to the test (until it can be removed from InputManager), or let this just sit here until it can be removed from Input Manager. It might be that the exception becomes version specific, but ideally not. Other ideas @jfreire-unity ? |
Description
As part of a pending Unity PR we ended up in a discussion whether Input System requires strictly increasing timestamps or not. This PR proves with an automated tests that timestamps do not have to be strictly incrementing, but should have timestamps greater or equal to the last received timestamp for the same source (device).
Skipping CHANGELOG update since test only.
Testing status & QA
Adds a single test.
Overall Product Risks
Comments to reviewers
Nothing special.
Checklist
Before review:
Changed,Fixed,Addedsections.Area_CanDoX,Area_CanDoX_EvenIfYIsTheCase,Area_WhenIDoX_AndYHappens_ThisIsTheResult.During merge:
NEW: ___.FIX: ___.DOCS: ___.CHANGE: ___.RELEASE: 1.1.0-preview.3.After merge: