-
-
Notifications
You must be signed in to change notification settings - Fork 7
Description
Description
In editorconfig-checker we received bug reports from our users, that they failed building editorconfig-checker. Upon closer inspection we determined that this started occurring when we introduced snapshot testing using go-snaps, and being caused by their build systems (Arch and Alpine) globally setting $GOFLAGS
to include -trimpath
.
Should you want to read back into our analysis, you can find it in editorconfig-checker/editorconfig-checker#397.
From my perspective this issue arises from -trimpath
trimming part of the path used by go-snaps to find it's __snapshots__
folders.
Steps to Reproduce
Run demonstrate.sh
from https://github.com/klaernie/trimpath-repro.
It demonstrates the issue by creating a directory which would be created by go-snaps, making it non-writable to everyone. It then demonstrates that running go test ./...
works fine, as long as GOFLAGS
does not contain -trimpath
.
Expected Behavior
snapshot verification should not depend if the test binary is build under -trimpath