Skip to content

chore: Makefile test-e2e-full uses sudo which causes root-owned files #70

@CodeMonkeyCybersecurity

Description

Summary

The Makefile target test-e2e-full (line 85) runs sudo -E go test, which creates test artifacts and cached files owned by root in the user's repository. This is the primary cause of the "unable to unlink old file: Permission denied" error during subsequent git pull operations.

Evidence

test-e2e-full:
    sudo -E go test -v -tags=e2e_full -timeout=60m ./test/e2e/full/...

After running this, 888 files become root-owned in the repo.

Proposed Fix

  1. Run e2e tests in a container or VM (not in the source tree with sudo)
  2. If sudo is required, add a cleanup step: sudo chown -R $(whoami):$(whoami) .
  3. Use go test -exec sudo pattern instead of sudo go test
  4. Add npm run repo:fix as post-test cleanup

References

  • POSIX file deletion requires write permission on parent directory
  • Git cannot unlink files in root-owned directories when running as non-root user

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions