Skip to content

Commit e2a7fc7

Browse files
committed
[FIX] website: lower the step safety check amount
The drag and drop mega test is quite simple: the python gets the list of all the snippets (by rendering a view + etree), then it just starts a JS tour by passing all those snippets in the tour URL. From there, the JS tour is in charged of building its own steps based on the list of snippets it received from the python. The MOST important part is to be 100% sure that the built steps are as expected: ~5 steps / snippets: ~220 steps with website only and ~280 steps with all modules. If we don't have that check, the tour could suddenly not test anything because the step list would be empty, but the test wouldn't fail. Thus, we don't want to programmatically try to compute that step amount but want it to remain an hardcoded number, which is lowered in this commit as if we have 220 (it could be 200, 150..) steps, it means that the steps were built as expected. Note that since the test is run on post_install, 280 was fine since all modules were installed. But the nightly build is also testing this test with only the website module, ultimately failing. Note that this check was actually not working at all since [1] as there was a typo on `length`. [1]: odoo@61b19da closes odoo#94605 X-original-commit: 23c6b49 Signed-off-by: Romain Derie (rde) <[email protected]>
1 parent 46a9e92 commit e2a7fc7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

addons/website/static/tests/tours/snippets_all_drag_and_drop.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ for (const snippet of snippetsNames) {
5959

6060
tour.register("snippets_all_drag_and_drop", {
6161
test: true,
62+
// To run the tour locally, you need to insert the URL sent by the python
63+
// tour here. There is currently an issue with tours which don't have an URL
64+
// url: '/?enable_editor=1&snippets_names=s_showcase,s_numbers,s_...',
6265
}, [
6366
{
6467
content: "Ensure snippets are actually passed at the test.",
@@ -67,7 +70,7 @@ tour.register("snippets_all_drag_and_drop", {
6770
// safety check, otherwise the test might "break" one day and
6871
// receive no steps. The test would then not test anything anymore
6972
// without us noticing it.
70-
if (steps.length < 270) {
73+
if (steps.length < 220) {
7174
console.error(`This test is not behaving as it should, got only ${steps.length} steps.`);
7275
}
7376
},

0 commit comments

Comments
 (0)