Skip to content
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

[FW][FIX] google_calendar: accepting recurrent event tests #162267

Conversation

fw-bot
Copy link
Contributor

@fw-bot fw-bot commented Apr 17, 2024

The test_accepting_recurrent_event_* tests make sure that accepting recurrent events on google side reflect in odoo. The test was failing because of the following:
when retrieving the invited attendee, the test used self.assertEqual(event.attendee_ids[1].state, expected_states[i]) assuming that organizer will be at index 0 and invited user at index 1. However the list of event.attendee_ids is ordered by create_date. And we create both organizer and attendee with the same command at the same time: partner_ids=[Command.set([self.organizer_user.partner_id.id, self.attendee_user.partner_id.id])] So we might have organizer at index 1 and invited attendee at index 0. This resulted in the indeterministic behavior of the test.

To fix this issue:
This commit changes how the invited attendee is retrieved, making sure that we always get the right attendee.

fixes runbot-61527

Forward-Port-Of: #161451

The `test_accepting_recurrent_event_*` tests make sure that accepting recurrent events on google side reflect in odoo.
The test was failing because of the following:
when retrieving the invited attendee, the test used `self.assertEqual(event.attendee_ids[1].state, expected_states[i])` assuming that organizer will be at index `0` and invited user at index `1`.
However the list of `event.attendee_ids` is ordered by create_date.
And we create both organizer and attendee with the same command at the same time: `partner_ids=[Command.set([self.organizer_user.partner_id.id, self.attendee_user.partner_id.id])]`
So we might have organizer at index `1` and invited attendee at index `0`. This resulted in the indeterministic behavior of the test.

To fix this issue:
This commit changes how the invited attendee is retrieved, making sure that we always get the right attendee.

fixes runbot-61527

X-original-commit: 6db2614
@robodoo
Copy link
Contributor

robodoo commented Apr 17, 2024

@fw-bot
Copy link
Contributor Author

fw-bot commented Apr 17, 2024

This PR targets saas-16.3 and is part of the forward-port chain. Further PRs will be created up to master.

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

@robodoo robodoo added the forwardport This PR was created by @fw-bot label Apr 17, 2024
@C3POdoo C3POdoo added the RD research & development, internal work label Apr 17, 2024
robodoo pushed a commit that referenced this pull request Apr 18, 2024
The `test_accepting_recurrent_event_*` tests make sure that accepting recurrent events on google side reflect in odoo.
The test was failing because of the following:
when retrieving the invited attendee, the test used `self.assertEqual(event.attendee_ids[1].state, expected_states[i])` assuming that organizer will be at index `0` and invited user at index `1`.
However the list of `event.attendee_ids` is ordered by create_date.
And we create both organizer and attendee with the same command at the same time: `partner_ids=[Command.set([self.organizer_user.partner_id.id, self.attendee_user.partner_id.id])]`
So we might have organizer at index `1` and invited attendee at index `0`. This resulted in the indeterministic behavior of the test.

To fix this issue:
This commit changes how the invited attendee is retrieved, making sure that we always get the right attendee.

fixes runbot-61527

closes #162267

X-original-commit: 6db2614
Signed-off-by: Ahmad Almaghraby (alah) <alah@odoo.com>
@robodoo robodoo closed this Apr 18, 2024
@fw-bot fw-bot deleted the saas-16.3-16.0-google-calendar-fix-recurrence-tests-alah-wBjc-fw branch May 2, 2024 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
forwardport This PR was created by @fw-bot RD research & development, internal work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants