Skip to content

improve cross-platform test compatibility #3158

Open
@theRealThomasDavidson

Description

@theRealThomasDavidson

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions