Skip to content

Centralize test file paths for downstream packagers#689

Merged
jlizen merged 2 commits into
tower-rs:mainfrom
jlizen:refactor/test-file-paths
May 23, 2026
Merged

Centralize test file paths for downstream packagers#689
jlizen merged 2 commits into
tower-rs:mainfrom
jlizen:refactor/test-file-paths

Conversation

@jlizen
Copy link
Copy Markdown
Member

@jlizen jlizen commented May 22, 2026

Supersedes #541

Motivation

Downstream packagers (Debian, Fedora) need to patch test file paths when the test fixtures live in a different location than the source tree.

Solution

Centralizes only the filesystem paths that packagers actually need to patch into constants at the top of each test module:

  • TEST_FILES_DIR ("../test-files")
  • README_PATH ("../README.md")
  • REPO_ROOT ("..") in serve_dir/tests.rs only

Everything else (header names, MIME types, URI paths, expected content strings) stays inline for readability.

Also normalizes the precompressed test file content to a consistent "Test file\n" (10 bytes) across precompressed.txt, missing_precompressed.txt, and only_gzipped.txt.gz, with all compressed variants regenerated. This simplifies the assertions and makes the test fixtures self-consistent.

Testing

Manually verified all compressed variants round-trip correctly (decompress to expected content). Tests still pass, also.

@jlizen jlizen changed the title Refactor/test file paths Centralize test file paths for downstream packagers May 22, 2026
@jlizen jlizen merged commit 0121e7e into tower-rs:main May 23, 2026
12 checks passed
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.

2 participants