Skip to content

fix(ci): stop two tests from assuming Linux - #40

Merged
YCistak merged 2 commits into
masterfrom
fix/cross-platform-tests
Aug 7, 2026
Merged

YCistak merged 2 commits into
masterfrom
fix/cross-platform-tests

Conversation

@YCistak

@YCistak YCistak commented Aug 7, 2026

Copy link
Copy Markdown
Owner

CI'ın kırmızı olmasının sebebi fatura değil — daha önce öyle sanıyorduk, o engel kalkmış. Altı job'un üçü gerçek test hatasıyla düşüyor ve ikisi de testin kendi varsayımı, üretim kodu doğru.

daemon (macos):   configPath() = "/Users/runner/Library/Application Support/pylon/pylon.yaml"
                  want         = "/var/folders/.../T/Test.../001/pylon/pylon.yaml"
daemon (windows): configPath() = "C:\Users\runneradmin\AppData\Roaming\pylon\pylon.yaml"
                  want         = "C:\Users\RUNNER~1\AppData\Local\Temp\...\pylon\pylon.yaml"

Ne değişti

  • TestConfigPathFallsBackToUserConfigDir — XDG_CONFIG_HOME'u geçici bir dizine kurup onu bekliyordu. Bu yalnızca Linux'un cevabı: macOS ~/Library/Application Support, Windows %AppData% diyor. Beklenti artık configPath'in danıştığı os.UserConfigDir()'den geliyor — iddia aynı kalıyor ("kullanıcı config dizini + pylon/pylon.yaml"), tek bir platformun düzeni kodlanmıyor. Test hiçbir şey yazmadığı için kum havuzuna da gerek yok.
  • Yeni test: configPath'in son dalı (ev dizini hiç yokken çıplak dosya adına düşmesi) hiç test edilmiyordu.
  • pylon-ui/go.mod → go 1.26.3 (kök modülle aynı). GUI ayrı bir modül olduğu için ikisini bir arada tutan hiçbir şey yoktu ve üç minor sürüm ayrılmışlardı. CI test job'una go.mod'dan, gui job'una pylon-ui/go.mod'dan Go kuruyor — yani iki job iki farklı toolchain'le derliyordu; release workflow'u ise ikisini de kökünkiyle derliyor. Yayınlanan GUI, CI'ın hiç test etmediği bir toolchain'le derlenmiş oluyordu.

Kalan macOS hatası #38'de

gui (macos) job'u pylon-ui/app_test.go'daki soket yolu uzunluğu yüzünden de düşüyordu. O dosyayı #38 zaten baştan yazıyor, düzeltme oraya kondu (134f20f). Master tamamen yeşile ancak bu PR ve #38 birlikte girince döner.

Doğrulama

go build/vet/make test, macOS + Windows çapraz derleme, GUI modülünün yeni direktifle derlenip test edilmesi (go.sum değişmedi) — hepsi temiz. Çapraz platform kısmının tek gerçek kanıtı bu PR'ın CI'ı.

🤖 Generated with Claude Code

YCistak and others added 2 commits August 7, 2026 13:39
CI is green on Linux and red on the macOS and Windows runners, and neither
failure is in the code under test — both are tests encoding this machine's
layout as if it were every machine's.

`TestConfigPathFallsBackToUserConfigDir` pointed XDG_CONFIG_HOME at a temp
directory and expected configPath to return it. That is only how Linux
answers: macOS resolves the user config directory to ~/Library/Application
Support and Windows to %AppData%, so the runners compared a real path against
a temp one and failed. The expectation now comes from os.UserConfigDir() —
the same function configPath consults — which keeps the assertion ("the user
config dir, plus pylon/pylon.yaml") without encoding one platform's layout.
Nothing is written, so the test needs no sandbox to be safe.

The last branch of configPath — no home directory at all, fall back to the
bare filename — had no test at all. It has one now, skipped on any OS that
still reports a config dir once the environment is cleared.

Also bring pylon-ui/go.mod's go directive to 1.26.3, matching the root. The
GUI is a separate module so nothing kept them together, and they had drifted
three minor versions apart. CI installs the daemon's Go from go.mod and the
GUI's from pylon-ui/go.mod, so the two jobs were building on different
toolchains — while the release workflow builds both with the root's. The GUI
that ships was compiled by a toolchain CI never tested it on.

Verified locally: go build/vet/test, macOS + Windows cross-compile, and the
GUI module builds, vets and tests under the new directive with go.sum
untouched. The cross-platform part can only be proven by CI itself.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The last of the three red jobs. The macOS runner failed every test that
stands up the fake daemon:

    listen unix /var/folders/df/…/T/TestGoogleStatusPassesDaemonAnswerThroughconnected…/001/s:
    bind: invalid argument

The helper already knew a Unix socket path is capped near 104 bytes — it
shortened the *filename* to "s" for exactly that reason. But the budget is
spent by the directory: t.TempDir() names its directory after the test, so a
long test name inside macOS's long $TMPDIR overruns the cap no matter how
short the file is called. Linux and Windows have room to spare, which is why
only one of the three runners noticed.

A plain temp directory keeps the path short whatever the test is named.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@YCistak
YCistak merged commit ed911fd into master Aug 7, 2026
6 checks passed
@YCistak
YCistak deleted the fix/cross-platform-tests branch August 7, 2026 11:03
YCistak added a commit that referenced this pull request Aug 10, 2026
* fix(ci): stop two tests from assuming Linux

CI is green on Linux and red on the macOS and Windows runners, and neither
failure is in the code under test — both are tests encoding this machine's
layout as if it were every machine's.

`TestConfigPathFallsBackToUserConfigDir` pointed XDG_CONFIG_HOME at a temp
directory and expected configPath to return it. That is only how Linux
answers: macOS resolves the user config directory to ~/Library/Application
Support and Windows to %AppData%, so the runners compared a real path against
a temp one and failed. The expectation now comes from os.UserConfigDir() —
the same function configPath consults — which keeps the assertion ("the user
config dir, plus pylon/pylon.yaml") without encoding one platform's layout.
Nothing is written, so the test needs no sandbox to be safe.

The last branch of configPath — no home directory at all, fall back to the
bare filename — had no test at all. It has one now, skipped on any OS that
still reports a config dir once the environment is cleared.

Also bring pylon-ui/go.mod's go directive to 1.26.3, matching the root. The
GUI is a separate module so nothing kept them together, and they had drifted
three minor versions apart. CI installs the daemon's Go from go.mod and the
GUI's from pylon-ui/go.mod, so the two jobs were building on different
toolchains — while the release workflow builds both with the root's. The GUI
that ships was compiled by a toolchain CI never tested it on.

Verified locally: go build/vet/test, macOS + Windows cross-compile, and the
GUI module builds, vets and tests under the new directive with go.sum
untouched. The cross-platform part can only be proven by CI itself.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* fix(gui): keep the fake daemon's socket path inside macOS's limit

The last of the three red jobs. The macOS runner failed every test that
stands up the fake daemon:

    listen unix /var/folders/df/…/T/TestGoogleStatusPassesDaemonAnswerThroughconnected…/001/s:
    bind: invalid argument

The helper already knew a Unix socket path is capped near 104 bytes — it
shortened the *filename* to "s" for exactly that reason. But the budget is
spent by the directory: t.TempDir() names its directory after the test, so a
long test name inside macOS's long $TMPDIR overruns the cap no matter how
short the file is called. Linux and Windows have room to spare, which is why
only one of the three runners noticed.

A plain temp directory keeps the path short whatever the test is named.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: YCistak <YCistak@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
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