Skip to content

[18.0][FIX] endpoint_route_handler: scope registry mutation in tests - #185

Merged
OCA-git-bot merged 1 commit into
OCA:18.0from
camptocamp:18-fix-endpoint_route_handler-test-registry-init
Oct 20, 2026
Merged

OCA-git-bot merged 1 commit into
OCA:18.0from
camptocamp:18-fix-endpoint_route_handler-test-registry-init

Conversation

@simahawk

Copy link
Copy Markdown
Contributor

Motivation

The mocked request in endpoint_route_handler tests set registry._init_modules to an empty set and never restored it. The registry is shared, so every routing map built afterwards lost the controllers of all modules. Tests of other modules run in the same process (eg: http_json_dispatcher) then got 404 on their routes.

Key changes

  • patch _init_modules only for the duration of the mocked request

@OCA-git-bot OCA-git-bot added series:18.0 mod:endpoint_route_handler Module endpoint_route_handler labels Oct 20, 2026
The mocked request set `registry._init_modules` to an empty set and never
restored it. The registry is shared, so every routing map built afterwards
dropped the controllers of all modules: tests of other modules (eg:
`http_json_dispatcher`) got 404 on their routes when run in the same
process.

Patch it only for the duration of the mocked request.
@simahawk
simahawk force-pushed the 18-fix-endpoint_route_handler-test-registry-init branch from 6b9fb64 to 53b2db0 Compare October 20, 2026 09:17
@simahawk simahawk changed the title [18.0][FIX] endpoint_route_handler: scope registry mutation in tests [FIX] endpoint_route_handler: scope registry mutation in tests Oct 20, 2026
@simahawk simahawk changed the title [FIX] endpoint_route_handler: scope registry mutation in tests [18.0][FIX] endpoint_route_handler: scope registry mutation in tests Oct 20, 2026
@simahawk

Copy link
Copy Markdown
Contributor Author

/ocabot merge patch

@OCA-git-bot

Copy link
Copy Markdown
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 18.0-ocabot-merge-pr-185-by-simahawk-bump-patch, awaiting test results.

@OCA-git-bot
OCA-git-bot merged commit 7326012 into OCA:18.0 Oct 20, 2026
7 checks passed
@OCA-git-bot

Copy link
Copy Markdown
Contributor

Congratulations, your PR was merged at 6dde9cf. Thanks a lot for contributing to OCA. ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants