-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Remove the getSelectedEditors integration test helper function
#19277
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
Remove the getSelectedEditors integration test helper function
#19277
Conversation
The `getSelectedEditors` function is largely a copy of the `getEditors` function, with three small differences: 1. `getEditors` allows getting any kind of editor whereas `getSelectedEditors` is harcoded to only getting selected editors. 2. `getEditors` returns editor selectors (strings) whereas `getSelectedEditors` returns editor IDs (integers). 3. `getSelectedEditors` returns a sorted array of editor IDs whereas `getEditors` does not ensure that the array is sorted. This commit makes the `getEditors` function a drop-in replacement for the `getSelectedEditors` function to deduplicate the code and to have a unified way of getting editors. Note that we don't actually use the contents of the returned array (only its length), so we can safely change `getEditors` to return a sorted array of integer editor IDs instead. Sorting the array makes the return value deterministic, which is a nice property for test stability, and integer IDs are also easier to handle in test assertions. Note that the corresponding selector strings can also easily be obtained from the integer IDs using the `getEditorSelector` function if needed.
e30dfa1 to
9d09c56
Compare
|
/botio integrationtest |
From: Bot.io (Windows)ReceivedCommand cmd_integrationtest from @timvandermeij received. Current queue size: 0 Live output at: http://54.193.163.58:8877/278436fa64389db/output.txt |
From: Bot.io (Linux m4)ReceivedCommand cmd_integrationtest from @timvandermeij received. Current queue size: 0 Live output at: http://54.241.84.105:8877/402430d98017adb/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/402430d98017adb/output.txt Total script time: 9.66 mins
|
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/278436fa64389db/output.txt Total script time: 24.49 mins
|
|
/botio integrationtest |
From: Bot.io (Linux m4)ReceivedCommand cmd_integrationtest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/8b70a6221ecbb75/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_integrationtest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.193.163.58:8877/2c6f4d86a8de172/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/8b70a6221ecbb75/output.txt Total script time: 10.30 mins
|
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/2c6f4d86a8de172/output.txt Total script time: 24.03 mins
|
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.
r=me, thank you.
The
getSelectedEditorsfunction is largely a copy of thegetEditorsfunction, with three small differences:getEditorsallows getting any kind of editor whereasgetSelectedEditorsis harcoded to only getting selected editors.getEditorsreturns editor selectors (strings) whereasgetSelectedEditorsreturns editor IDs (integers).getSelectedEditorsreturns a sorted array of editor IDs whereasgetEditorsdoes not ensure that the array is sorted.This commit makes the
getEditorsfunction a drop-in replacement for thegetSelectedEditorsfunction to deduplicate the code and to have a unified way of getting editors.Note that we don't actually use the contents of the returned array (only its length), so we can safely change
getEditorsto return a sorted array of integer editor IDs instead. Sorting the array makes the return value deterministic, which is a nice property for test stability, and integer IDs are also easier to handle in test assertions. Note that the corresponding selector strings can also easily be obtained from the integer IDs using thegetEditorSelectorfunction if needed.Fixes a part of #19065.