Windows: 16 tests in `tests/test_cli.py` fail, and the CI test job only runs on Linux

Open Beginner friendly
#2,779 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
github-actions, python
Domain
testing

Research direction

Start with the failing cases in tests/test_cli.py, especially the path regex, path comparisons, and file mode assertion; then review the test job in .github/workflows/main.yml to see how CI is configured. Fix the reported Windows portability failures and run pytest tests/test_cli.py on Windows. Done when those portability tests pass; the reported symlink failures depend on the runner's symlink privilege.

Written by the indexing model from the issue text.

Description

On Windows 11 with Python 3.11.9, at 5aafc3d, uv-free setup with pip install -e ./logfire-sdk -e ./logfire and the dev group, pytest tests/test_cli.py gives 346 passed and 16 failed. The test job in .github/workflows/main.yml uses runs-on: ubuntu-latest, so CI does not see these.

Real test portability bugs: test_whoami and test_whoami_logged_in build a regex from the raw temp path (IsStr(regex=rf'^Credentials loaded from data dir: {tmp_dir_cwd}')), which raises re.error: incomplete escape \U. test_whoami_without_data and test_whoami_default_dir fail comparing backslash paths. test_read_token_save_writes_the_file_and_prints_nothing asserts POSIX file modes ((33206 & 63) == 0).

Not bugs: test_*symlink* fail with WinError 1314 because my account lacks the symlink privilege.

Happy to send a small PR limited to tests/test_cli.py if that is wanted.

Investigated with AI assistance (Claude Code). I ran and checked the results above myself.

Dominant language
Python
Stars
4.5k
Forks
365
Avg merge
1d 8h
Merged PRs (30d)
153

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from pydantic/logfire

All issues in pydantic/logfire

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.