-
Notifications
You must be signed in to change notification settings - Fork 450
test: all runtime tests passing on consoles #1647
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
Closed
NoelStephensUnity
wants to merge
62
commits into
experimental-develop
from
test/all-runtime-tests-passing-on-consoles
Closed
Changes from all commits
Commits
Show all changes
62 commits
Select commit
Hold shift + click to select a range
4b40c04
fix
NoelStephensUnity 859d88c
style
NoelStephensUnity ae1c750
Merge branch 'develop' into fix/console-tests-failing
NoelStephensUnity c022e08
fix - partial
NoelStephensUnity 9628212
style
NoelStephensUnity 0e4435b
Merge branch 'develop' into fix/console-tests-failing
NoelStephensUnity 5b6146a
fix
NoelStephensUnity 26d2335
style
NoelStephensUnity 041e10d
fix
NoelStephensUnity 7766f27
fix
NoelStephensUnity 554bf0d
style
NoelStephensUnity 402210e
Merge branch 'develop' into fix/console-tests-failing
NoelStephensUnity 43e9382
update
NoelStephensUnity 8244627
Merge branch 'fix/console-tests-failing' of https://github.com/Unity-…
NoelStephensUnity d509fca
Merge branch 'develop' into fix/console-tests-failing
NoelStephensUnity 90b9ed9
Merge branch 'develop' into fix/console-tests-failing
NoelStephensUnity 96b62b4
update
NoelStephensUnity 71ae813
refactor
NoelStephensUnity 3a90687
refactor
NoelStephensUnity 82d243f
revert
NoelStephensUnity 72d3d49
refactor
NoelStephensUnity 91d8f31
Merge branch 'develop' into fix/console-tests-failing
NoelStephensUnity d5efbe6
refactor
NoelStephensUnity d8e5b1f
refactor
NoelStephensUnity 33e6601
refactor
NoelStephensUnity 02e4681
style
NoelStephensUnity a66d4f3
style
NoelStephensUnity feb9e47
Merge branch 'develop' into fix/console-tests-failing
NoelStephensUnity a967264
update
NoelStephensUnity 2f18881
fix
NoelStephensUnity 0b955fe
fix
NoelStephensUnity 1ee1297
fix
NoelStephensUnity c47ea65
fix
NoelStephensUnity 2fa12fa
fix
NoelStephensUnity bee18d3
Merge branch 'develop' into fix/test-roject-runtimetests-standalone-t…
NoelStephensUnity 2480daf
Merge branch 'develop' into fix/test-roject-runtimetests-standalone-t…
NoelStephensUnity 73340d6
Merge branch 'develop' into fix/console-tests-failing
NoelStephensUnity 67566d6
refactor
NoelStephensUnity 76af4d4
test
NoelStephensUnity 312a5f5
test
NoelStephensUnity 5319473
revert
NoelStephensUnity a2f6fca
test
NoelStephensUnity 35b47a5
test refactor
NoelStephensUnity 994d459
Merge branch 'develop' into fix/console-tests-failing
NoelStephensUnity 71a4d4e
Merge branch 'develop' into fix/console-tests-failing
NoelStephensUnity 091d82f
test refactor
NoelStephensUnity f8fd60c
test update and style
NoelStephensUnity 38ec0fe
update
NoelStephensUnity 0f9d8ca
update
NoelStephensUnity 3088309
fix
NoelStephensUnity ba3e09d
style
NoelStephensUnity 3e70580
update
NoelStephensUnity 861ef54
fix and update
NoelStephensUnity 5915c3e
test fix
NoelStephensUnity 82606ea
test update
NoelStephensUnity 36c52d7
style
NoelStephensUnity 85fded2
style
NoelStephensUnity 8ad9b42
fix
NoelStephensUnity ce84aba
test update
NoelStephensUnity 1c2d493
style
NoelStephensUnity 455a756
Revert "test"
NoelStephensUnity 120073d
Merge branch 'fix/console-tests-failing' into test/all-runtime-tests-…
NoelStephensUnity File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
Something to consider here: What this test is really trying to do is wait for messages to be sent and received and then assert that the values have changed. Waiting for the values to change like this is kind of mixing the precondition with the assertion - if the assertion fails we wait forever.
In general, I would like to see us moving in the direction in our test code of waiting for distinct preconditions that are not part of what's being tested, and then asserting on the expected result. So in this case, using
WaitForMessageOfType<SnapshotDataMessage>
orWaitForMessageOfType<NetworkVariableDeltaMessage>
(not sure if snapshots are on or not for this test) and then asserting that all the values have changed.Reading this test as it's written now, if I were to interpret the written code as a "given-when-then" statement, I would word it as "Given an object with network variables on multiple clients, when all clients have changed the values of their variables, waiting for them to change doesn't time out".
I know this is a pretty pedantic comment, but I think moving toward smaller, more discreet tests that test only one thing and are very clear about what they're testing by what's inside the one assert, will ultimately make our test code better, cleaner, and easier to maintain.
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.
There are other places in this PR where this comment also applies, but I'm going to only mention it the once. It might be something to address later rather than now.
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.
(This comment, btw, is directed at myself as well. I've been guilty of this in the past, too. I've been trying to learn more about good test design and this is something I've learned has value over the last few months.)
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.
Actually, that is why I switched it over to the +new+ WaitForConditionOrTimeOut. It will wait for a condition to be reached and if the condition is never met it will stop waiting and the new assert below checks to see if it timed out or not. If not, it moves on, but if so then it asserts with a meaningful/unique message that makes troubleshooting a failed integration test easier to find.