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 some flaky test in meta/ SerializeEntityToJson #1313

Merged
merged 1 commit into from
Aug 22, 2024

Conversation

jpeletier
Copy link
Contributor

@jpeletier jpeletier commented Aug 19, 2024

While working on #1215 I noticed some tests of the meta add-on would not pass due to varying entity ids and for alerts, the order of alerts.
So I fixed two tests. For the first one, I gave entities fixed names so we would not be testing against entity ids which can vary.

For the second test, it is more complicated to make it perfect without a JSON library. The order of alerts in the alerts array is of undetermined order, causing the test to fail depending on arbitrary code changes elsewhere, Therefore I wrote an approximation searching for substrings to find the expected alerts in a deterministic way. This should be good enough I think.

@jpeletier
Copy link
Contributor Author

regex not available in windows builds. I'll be back...

@jpeletier
Copy link
Contributor Author

fixed!

@jpeletier jpeletier force-pushed the flaky-serialize-json branch 2 times, most recently from a6addec to 4c24265 Compare August 21, 2024 22:44
@SanderMertens
Copy link
Owner

Thanks for the PR!

@SanderMertens SanderMertens merged commit dea8543 into SanderMertens:master Aug 22, 2024
70 checks passed
@jpeletier jpeletier deleted the flaky-serialize-json branch August 23, 2024 06:19
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.

2 participants