Skip to content

Run the integration suite on Windows - #1

Open
lofoneh wants to merge 1 commit into
pgrundev:mainfrom
lofoneh:win-tests
Open

Run the integration suite on Windows#1
lofoneh wants to merge 1 commit into
pgrundev:mainfrom
lofoneh:win-tests

Conversation

@lofoneh

@lofoneh lofoneh commented Aug 29, 2026

Copy link
Copy Markdown

Problem

write_fake_pgbot generates the fake pgbot as a POSIX shell script, so the
three integration test files are #![cfg(unix)]. On Windows they don't fail —
they compile away:

                      before   after
  src/ unit tests         96      96
  cli_add                  0      12
  monitor                  0       2
  runner_integration       0       8

22 tests, including dsn_travels_by_env_not_argv and
add_failure_saves_nothing_and_leaks_nothing.

Change

tests/bin/fake_pgbot.rs ports the fixture to Rust as a fake-pgbot bin
target. write_fake_pgbot copies it into the test's temp dir, where it finds
invocations.log / running.<pid> / peaks.log via current_exe().parent()
so the helper's signature is unchanged and no assertion was touched. Drops the
three #![cfg(unix)] lines, adds windows-latest to CI. saved_file_is_0600
stays unix-only.

Also fixes a latent flake: writeln! emits the value and the newline as
separate writes, so concurrent fakes interleaved into peaks.log as
"22\n\n1\n" and the cap test read a peak of 22. Now one write_all.

fmt, clippy and cargo test --locked pass on Windows; linux and macOS
unverified until CI runs.

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.

1 participant