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

improve cross-platform test compatibility #3158

Open
theRealThomasDavidson opened this issue Feb 18, 2025 · 0 comments · May be fixed by #3157
Open

improve cross-platform test compatibility #3158

theRealThomasDavidson opened this issue Feb 18, 2025 · 0 comments · May be fixed by #3157

Comments

@theRealThomasDavidson
Copy link

Several tests are failing on Windows due to inconsistent handling of path separators and line endings. The main issues are:

  1. Path Separator Issues:
  • URL paths using Windows backslashes instead of forward slashes
  • Inconsistent path comparison in tests between Windows and Unix systems
  • Import map paths not normalized across platforms
  1. Line Ending Issues:
  • Test comparisons failing due to \r\n vs \n differences
  • SQL statement comparisons affected by platform-specific line endings
  • Form data comparisons failing due to line ending mismatches
  1. Test Data Handling:
  • File system operations not properly handling cross-platform paths
  • Test fixtures using hardcoded path separators

Affected areas:

  • Function deployment tests
  • Storage operations
  • Migration tests
  • Config parsing tests
  • Token parsing tests

Proposed Solution:

  1. Add consistent path normalization using filepath.ToSlash/FromSlash
  2. Normalize line endings in test comparisons
  3. Use platform-agnostic path handling for URLs
  4. Add helper functions for consistent line ending handling
  5. Replace testImports with in-memory filesystem for better control

This will improve test reliability across different operating systems and prevent platform-specific test failures.

@theRealThomasDavidson theRealThomasDavidson linked a pull request Feb 18, 2025 that will close this issue
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 a pull request may close this issue.

1 participant