fix: isolate config tests from the host dokku installation

The config tests wrote to the real `DOKKU_ROOT` and `DOKKU_LIB_ROOT`, including the global `ENV` file, and relied on a `dokku` user and group existing. That held only because the result of applying ownership was discarded; now that it is reported, the tests failed under `ci-go-coverage`, which runs them in a build image that has no `dokku` user. They now use the temporary directories and current-user ownership the migration tests already use.
This commit is contained in:
Jose Diaz-Gonzalez committed 2026-09-18 01:05:35 -04:00
1 parent 0c3ae47299
commit e715944c86
2 files changed
+33 -70

No files matched your search

+3 -3
View File
@@ -11,9 +11,9 @@ import (
// setupIsolatedEnv points the dokku env at temporary directories and tells the
// permission helpers to chown files to the current user (a no-op) so the test
// works without root. The package-level paths in config_test.go are captured at
// init against the real dokku directories, so a test using this helper must not
// use them.
// works without root and without a dokku user existing. Every test in this
// package goes through it, directly or via setupTestApp, so none of them touch
// a real dokku installation.
func setupIsolatedEnv(t *testing.T) (dokkuRoot string, libRoot string) {
t.Helper()