Skip to content

Fix test issues: 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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Kunal-Darekar
Copy link

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.

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
Contributor

Hey there and thank you for opening this pull request! 👋🏼

We require pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted.

Details:

No release type found in pull request title "Fix test issues: Improve UTF-8 encoding and test reliability". Add a prefix to indicate what kind of release this pull request corresponds to. For reference, see https://www.conventionalcommits.org/

Available types:
 - feat: A new feature
 - fix: A bug fix
 - docs: Documentation only changes
 - style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
 - refactor: A code change that neither fixes a bug nor adds a feature
 - perf: A code change that improves performance
 - test: Adding missing tests or correcting existing tests
 - build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
 - ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
 - chore: Other changes that don't modify src or test files
 - revert: Reverts a previous commit

Copy link
Contributor

No linked issues found. Please add the corresponding issues in the pull request description.
Use GitHub automation to close the issue when a PR is merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant