Skip to content

test: add UTF-8 encoding regression tests (#5566)#7880

Open
hsms4710-pixel wants to merge 1 commit into
microsoft:mainfrom
hsms4710-pixel:fix/add-utf8-encoding-test-5566
Open

test: add UTF-8 encoding regression tests (#5566)#7880
hsms4710-pixel wants to merge 1 commit into
microsoft:mainfrom
hsms4710-pixel:fix/add-utf8-encoding-test-5566

Conversation

@hsms4710-pixel

@hsms4710-pixel hsms4710-pixel commented Jun 24, 2026

Copy link
Copy Markdown

Why are these changes needed?

This PR adds comprehensive regression tests to prevent future encoding issues in AutoGen (Issue #5566).

After the fix for #5566 was merged, there were no tests to prevent regression. If someone accidentally removes encoding="utf-8" in the future, the bug will return. These tests catch that.

Related issue number

Fixes #5566

Checks

📝 Description

This PR adds comprehensive regression tests to prevent future encoding issues in AutoGen.

Changes

  • ✅ Added test_encoding.py with 5 test cases
  • ✅ Static analysis test to detect missing encoding parameters
  • ✅ Tests for UTF-8 file operations
  • ✅ Test for page_script.js UTF-8 validity

Testing

  • Tests added
  • CI tests passing (to be verified)
  • Manual review completed

Why This Matters

After the fix for #5566 was merged, there's no test to prevent regression.
If someone accidentally removes encoding="utf-8" in the future,
the bug will return. These tests catch that.

🧪 Test Coverage

  1. test_playwright_controller_script_loading - Verifies source code has encoding parameter
  2. test_file_operations_with_utf8_encoding - Tests UTF-8 file read/write
  3. test_multimodal_web_surfer_encoding - Placeholder for WebSurfer tests
  4. test_no_encoding_issues_in_source - Static analysis to detect missing encoding
  5. test_page_script_js_is_valid_utf8 - Validates page_script.js is valid UTF-8

✅ Checklist

  • Code follows project style guidelines
  • Self-review completed
  • Tests added
  • Documentation updated (not needed for test files)

@hsms4710-pixel

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

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.

open needs encoding='utf-8' for non-english environment, error in playwright_controller.py

2 participants