-
Notifications
You must be signed in to change notification settings - Fork 854
fix: Make translation test less flaky #2449
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
Conversation
|
/azp run |
|
Hey @BrendanWalsh 👋! We use semantic commit messages to streamline the release process. Examples of commit messages with semantic prefixes:
To test your commit locally, please follow our guild on building from source. |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2449 +/- ##
==========================================
- Coverage 84.38% 83.91% -0.48%
==========================================
Files 335 335
Lines 17690 17688 -2
Branches 1619 1610 -9
==========================================
- Hits 14928 14842 -86
- Misses 2762 2846 +84 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR addresses flakiness in translation service tests by replacing strict equality assertions with more flexible containment checks. The changes account for variation in translation service responses (e.g., different but equivalent Chinese greetings like "早上好" vs "早安"), which helps prevent test failures due to non-deterministic API behavior rather than actual bugs.
Key Changes:
- Replaced exact string matches (
===or==) with flexible assertions usingcontains()checks that accept multiple valid translation alternatives - Added intermediate variables to store results before asserting on them for better readability
- Introduced alternative acceptable translations for Chinese phrases (e.g., "嗨" or "你好" for greetings, "再见" or "拜拜" for goodbye)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
* fix: Make translation test less flaky * Make another check more flexible * increased flexibility * fix scalastyle
* fix: Make translation test less flaky * Make another check more flexible * increased flexibility * fix scalastyle
Test previously required one specific greeting to be returned by the translation service. Now making it slightly more flexible.