Skip to content

Fix tests for Windows and add Windows to CI - #778

Open
altradits wants to merge 1 commit into
nokia:masterfrom
altradits:fix-windows-tests
Open

altradits wants to merge 1 commit into
nokia:masterfrom
altradits:fix-windows-tests

Conversation

@altradits

Copy link
Copy Markdown

Description

This PR addresses issue #629 by resolving test failures on Windows caused by hardcoded POSIX path separators and drive letter assumptions, and adds Windows to the GitHub Actions CI matrix.

Summary of Changes

  • internal/cache: Normalize cache directory expectations using filepath.Join and filepath.FromSlash.
  • internal/fs: Construct file URIs with span.URIFromPath in TestBytesFromURL to encode Windows drive letters properly; normalize expectations in TestJoinPath and TestTTCN3Files with filepath.FromSlash.
  • internal/lsp: Normalize expected file paths in hover tests with filepath.FromSlash. Dynamically derive the working drive in uri_windows_test.go so tests succeed on runners using D:\.
  • project: Use filepath.FromSlash for relative hooks_file assertions and account for Windows relative path semantics for "/file".
  • ci: Add windows-latest (and macos-latest) to the CI test matrix. Enable Git core.longpaths on Windows before actions/checkout to support deep paths in testdata/ttcn3-conformance-tests/.

Closes #629

Some tests failed on Windows machines due to hardcoded POSIX path
separators and assumptions about drive letters.

Normalize test expectations across the suite:
- internal/cache: use native path separators with filepath.Join and
  filepath.FromSlash for cache directory lookups.
- internal/fs: construct file URIs using span.URIFromPath to properly
  encode Windows drive letters, and normalize path expectations in
  TestJoinPath and TestTTCN3Files with filepath.FromSlash.
- internal/lsp: normalize expected file paths in hover tests with
  filepath.FromSlash, and dynamically determine the working drive in
  uri_windows_test.go so tests pass on CI runners using D:\.
- project: use filepath.FromSlash for relative hooks_file assertions
  and handle Windows relative path behavior for "/file".
- ci: add windows-latest to the test matrix, and enable Git
  core.longpaths on Windows before checkout to handle long paths in
  conformance tests.

Fixes nokia#629
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.

Fix tests for windows

1 participant