Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

fix: cross-platform test compatibility#3157

Open
theRealThomasDavidson wants to merge2 commits intosupabase:develop
base:develop
Choose a base branch
Loading
fromtheRealThomasDavidson:fix/cross-platform-tests-clean

Conversation

theRealThomasDavidson
Copy link

@theRealThomasDavidsontheRealThomasDavidson commentedFeb 18, 2025
edited
Loading

This PR fixes various cross-platform compatibility issues in tests, particularly between Windows and Unix-like systems.

Changes Made:

  1. Path Separator Handling:
  • Addedfilepath.ToSlash() for error message comparison and import map paths indeploy_test.go
  • Addedfilepath.ToSlash() conversion for URL paths in storage operations
  • Normalized path comparisons usingfilepath.ToSlash() for cross-platform compatibility indeno_test.go
  1. Line Ending Normalization:
  • Added comprehensive string normalization for form comparisons inupload_test.go:
    • Path separator normalization
    • Line ending normalization (\r\n -> \n)
    • Consecutive newline normalization
    • Backslash escaping normalization
  • Added line ending normalization for diff comparisons insquash_test.go
  • AddednormalizeLineEndings() helper function inauth_test.go andtoken_test.go
  1. Test Data Handling:
  • Replaced testImports with in-memory filesystem setup usingafero.NewMemMapFs()
  • Added proper path handling for test file creation

Testing:

  • Verified tests pass on both Windows and Unix systems
  • Ensured URL paths consistently use forward slashes
  • Confirmed line ending normalization works across platforms

Related Issue:

Fixes#3158

Improve test reliability across Windows and Unix systems:* Add path separator normalization (filepath.ToSlash/FromSlash)* Normalize line endings (\\r\\n -> \\n) in test comparisons* Fix URL path handling in storage operations* Replace testImports with in-memory filesystem* Add helper functions for consistent line ending handling
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

improve cross-platform test compatibility
1 participant
@theRealThomasDavidson

[8]ページ先頭

©2009-2025 Movatter.jp