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

Fix fails in gen-zigbee unit tests #1368

Merged
merged 1 commit into from
Jul 25, 2024

Conversation

ethanzhouyc
Copy link
Collaborator

@ethanzhouyc ethanzhouyc commented Jul 24, 2024

  • Fix possible fails in gen-zigbee-x.test.js unit tests due to inconsistent execution order in async functions

  • Replace .then() with await and replace forEach with for loop in ensurePackagesAndPopulateSessionOptions to ensure proper async flow

  • Keep using promises in other parts of the function for faster parallel execution

@ethanzhouyc ethanzhouyc changed the title Fix fails in gen-zibee unit tests Fix fails in gen-zigbee unit tests Jul 24, 2024
@ethanzhouyc ethanzhouyc marked this pull request as ready for review July 25, 2024 14:31
@dhchandw
Copy link
Collaborator

dhchandw commented Jul 25, 2024

Mentioning the name of function changed and mentioning its role in these tests might be useful.

…zigbee unit tests

- Fix possible fails in gen-zigbee-x.test.js unit tests due to inconsistent execution order in async functions

- Replace .then() with await and replace forEach with for loop in ensurePackagesAndPopulateSessionOptions to ensure proper async flow

- Keep using promises in other parts of the function for faster parallel execution
selectedGenTemplatePackages &&
selectedGenTemplatePackages.length > 0
) {
for (const gen of selectedGenTemplatePackages) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor stuff const genPkgId gives more readability but not a big deal.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to break this long function into smaller pieces but that can be done on a later date so do not worry about it now.

@ethanzhouyc ethanzhouyc merged commit ec08b19 into project-chip:master Jul 25, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants