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
HOOT: various imps & fixes part 14 #158916
Closed
Closed
Conversation
This file contains 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
Arcasias
force-pushed
the
saas-17.2-hoot-jum-2
branch
7 times, most recently
from
March 27, 2024 12:12
9a27819
to
fe12c51
Compare
C3POdoo
requested review from
a team and
Julien00859
and removed request for
a team
March 27, 2024 12:17
Arcasias
force-pushed
the
saas-17.2-hoot-jum-2
branch
3 times, most recently
from
March 27, 2024 14:25
be42b81
to
7467f6d
Compare
seb-odoo
reviewed
Mar 28, 2024
Arcasias
force-pushed
the
saas-17.2-hoot-jum-2
branch
5 times, most recently
from
March 28, 2024 14:30
2aa1535
to
5ebddc2
Compare
This commit removes HOOT and HOOT-DOM from the list of exclusions in the tooling configuration file (_jsconfig.json). This effectively allows HOOT and HOOT-DOM to be included in the tooling and to be auto-formatted and linted when committing changes.
This commit adds the test path and name in the warning logged by `expect(...).toEqual(...)` in case the values are strictly equal. This is useful to identify which test is concerned by the warning.
This commit temporarily disables the "Stop" button in the UI after clicking on it to avoid immediatly re-running the test runner right after stopping it.
This commit ensures that all registries are registered for cleanup after every single test. Before this commit, this was partially the case as registries were registered for cleanup when creating a mock environment. This means that before that any content that was modified before that point would NOT be cleaned up.
robodoo
pushed a commit
that referenced
this pull request
Mar 28, 2024
This commit removes HOOT and HOOT-DOM from the list of exclusions in the tooling configuration file (_jsconfig.json). This effectively allows HOOT and HOOT-DOM to be included in the tooling and to be auto-formatted and linted when committing changes. Part-of: #158916
robodoo
pushed a commit
that referenced
this pull request
Mar 28, 2024
This commit adds the test path and name in the warning logged by `expect(...).toEqual(...)` in case the values are strictly equal. This is useful to identify which test is concerned by the warning. Part-of: #158916
robodoo
pushed a commit
that referenced
this pull request
Mar 28, 2024
This commit temporarily disables the "Stop" button in the UI after clicking on it to avoid immediatly re-running the test runner right after stopping it. Part-of: #158916
robodoo
pushed a commit
that referenced
this pull request
Mar 28, 2024
This commit ensures that all registries are registered for cleanup after every single test. Before this commit, this was partially the case as registries were registered for cleanup when creating a mock environment. This means that before that any content that was modified before that point would NOT be cleaned up. Part-of: #158916
robodoo
pushed a commit
that referenced
this pull request
Mar 28, 2024
This commit changes the shape of the `onRpc` helper and its variants: Before: there were 3 shapes: - `onRpc(route, routeCallback, routeOptions)` (with `routeCallback` taking the `request` object as sole argument); - `onRpc(ormCallback)` (with `ormCallback` taking the a string route and a params dictionnary as arguments); - `onRpc(method, ormCallback)` (same as above). Now: - both ORM versions of `onRpc` have had their parameters merged into a single dictionary, with the route being a key of this dictionary, as well as 2 other keys: `request` (original RPC `request` object) and `parent` (equivalent to "super"); - a 4th shape has been added: `onRpc(model, method, ormCallback)`. Docstring of all impacted functions, and usage of all impacted tests have been updated to reflect these changes. Part-of: #158916
robodoo
pushed a commit
that referenced
this pull request
Mar 28, 2024
This commit allows the `:eq` pseudo-class to support negative indexes, behaving the same as `Array.prototype.at` does. Part-of: #158916
robodoo
pushed a commit
that referenced
this pull request
Mar 28, 2024
This commit removes the `expect.extend` method that could be used to register new matcher methods. The reason for this is that it was first implemented because other test frameworks would also implement an extension system, but this is not really needed in HOOT because : - we already have full control over the lib, so generic matchers can directly be added to the source code; - more specific helpers can still be added in local test files or other test helper files as regular functions (which was already done with QUnit tests). Also the system was poorly documented in itself and would not provide autocompletion for newly added matchers, which could easily lead to misuse for declaration and usage of matchers. Part-of: #158916
robodoo
pushed a commit
that referenced
this pull request
Mar 28, 2024
This commit introduces several helpers: - a new `toHaveRect` matcher: it checks if the target's DOM rect matches the given rect; - 2 new helpers `queryRect` and `queryAllRects` that return the DOM rect of the target element(s). Part-of: #158916
robodoo
pushed a commit
that referenced
this pull request
Mar 28, 2024
This commit fixes several things in the mock model: - in `_unityReadRecords`: when reading reference fields, we must read a related record, whose model and id are encoded in the value of the reference fields. Before this commit, we read the record on the wrong model (the main one, not the one of the reference field); - in `_unityReadRecords`: when specifying the order, the method ordering the records would not be given the actual record list to sort and would instead take all available records; - when parsing a view, an error would be thrown on comment node as the only ignored node type was the text node. Now, all non-element nodes are ignored instead; - it removes a call to `isSameNode`, which use is discouraged; Part-of: #158916
robodoo
pushed a commit
that referenced
this pull request
Mar 28, 2024
This commit fixes a time test in HOOT that failed randomly. The issue came from an interval whose duration was too short, causing it to trigger multiple times in some cases. This commit increases all timers duration in that test to make sure it does not happen again. Part-of: #158916
robodoo
pushed a commit
that referenced
this pull request
Mar 28, 2024
This commit ensures that a single call to the server `get_definitions` is performed for all models that will be needed in the current test run at the start of the run. It also allows models fetched from the server to ignore inheritance from models that have not been fetched. Part-of: #158916
robodoo
pushed a commit
that referenced
this pull request
Mar 28, 2024
Before this commit, the callbacks given to the `onError` helper could be asynchronous and their result would be awaited before processing an error. The issue is that dispatching an error event is synchronlous by nature and the error could be prevented by subscribers registered later on even before the error can be processed by HOOT. This commit ensures that the `onError` callbacks are called synchronlously. closes #158916 Related: odoo/enterprise#59291 Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
This was referenced Apr 3, 2024
Closed
Closed
Draft
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Part 1: #152930
Part 2: #153018
Part 3: #153023
Part 4: #153203
Part 5: #153425
Part 6: #153700
Part 7: #154054
Part 8: #154579
Part 9: #155073
Part 10: #155639
Part 11: #156255 / https://github.com/odoo/enterprise/pull/58135
Part 12: #156869
Part 13: #158384 / https://github.com/odoo/enterprise/pull/59019
Enterprise: https://github.com/odoo/enterprise/pull/59291
This pull requests brings various improvements and fixes to Hoot and the Odoo unit test ecosystem. See the different commit messages for more details.
Note: these changes are made in stable to avoid having to support multiple versions of the HOOT API. As such, these changes are intended to be strictly limited to unit tests as to not put the rest of the code base at risk.
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr