Skip to content

fix: Improve UTF-8 encoding and test reliability #4813

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

Closed

Conversation

Kunal-Darekar
Copy link
Contributor

@Kunal-Darekar Kunal-Darekar commented May 15, 2025

This PR addresses the test-related issues identified in the review of PR #4721 (FluxCD provider implementation). These changes have been separated into a dedicated PR as requested by the reviewer.

Changes:
UTF-8 Encoding Improvements:
Added explicit UTF-8 encoding to all file operations in scripts/docs_render_provider_snippets.py
Removed exception handling for UnicodeDecodeError to ensure all files use UTF-8 encoding
Path Normalization for Cross-Platform Compatibility:
Added path separator normalization (replacing backslashes with forward slashes)
Added clear comments explaining the purpose of path normalization
Ensures consistent paths on Windows and Unix-like systems
Test Reliability Improvements:
Increased sleep time from 1 to 2 seconds in tests/e2e_tests/incidents_alerts_tests/incidents_alerts_setup.py
Increased max attempts from 10 to 30
Added detailed error reporting with more debugging information
Added comprehensive comments explaining the changes
These improvements help reduce flaky test failures, especially in CI environments, and ensure consistent behavior across different platforms.

Closes #4834

Related:
Addresses feedback from PR #4721

1. Add UTF-8 encoding to file operations in docs_render_provider_snippets.py
2. Normalize path separators for cross-platform compatibility
3. Improve test reliability by increasing sleep time and max attempts
4. Add detailed comments explaining the changes

These changes address the feedback from PR keephq#4721 review.
Copy link

vercel bot commented May 15, 2025

@Kunal-Darekar is attempting to deploy a commit to the KeepHQ Team on Vercel.

A member of the Team first needs to authorize it.

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label May 15, 2025
Copy link
Member

@talboren talboren left a comment

Choose a reason for hiding this comment

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

LGTM

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label May 19, 2025
@talboren talboren changed the title Fix test issues: Improve UTF-8 encoding and test reliability fix: Improve UTF-8 encoding and test reliability May 19, 2025
@talboren
Copy link
Member

@Kunal-Darekar can you open a respective issue for this PR and set it in the description?

close #xxxx

Copy link

vercel bot commented May 19, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
keep ⬜️ Ignored (Inspect) Visit Preview May 19, 2025 8:58am

@Kunal-Darekar
Copy link
Contributor Author

@talboren I've created issue #4834 for tracking these test improvements.

@talboren
Copy link
Member

Closing in favor of the PR that already includes it.

@talboren talboren closed this May 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm This PR has been approved by a maintainer size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[🐛 Bug]: Test failures due to encoding issues
2 participants