From 4ae48c6ea01578ca55fe843516f01d5143579c84 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 31 May 2026 02:23:35 -0400 Subject: [PATCH] test: pin test-env system identity and core-plugins path PropertyMap tests went through SetPermissions, which looks up the `dokku` user/group; the fresh `golang:1.26.2` container used by `go-test-plugin-in-docker` has neither, so the chown failed with `unknown group dokku`. Override `DOKKU_SYSTEM_USER` and `DOKKU_SYSTEM_GROUP` to `root` in the property and chart-migration test setups so the chown targets an identity that exists everywhere. The config tests also called `plugn trigger post-config-update` without `PLUGIN_CORE_AVAILABLE_PATH` set, so the hook tried to source `/common/functions` and logged a noisy warning on every test; point the env var at the canonical `/var/lib/dokku/core-plugins/available` location. --- plugins/common/properties_test.go | 2 ++ plugins/config/config_test.go | 6 +++++- plugins/scheduler-k3s/triggers_test.go | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/plugins/common/properties_test.go b/plugins/common/properties_test.go index 3c2954720..cdf44a052 100644 --- a/plugins/common/properties_test.go +++ b/plugins/common/properties_test.go @@ -19,6 +19,8 @@ func setupPropertyMapTest(t *testing.T) { RegisterTestingT(t) Expect(setupTests()).To(Succeed()) t.Setenv("DOKKU_LIB_ROOT", t.TempDir()) + t.Setenv("DOKKU_SYSTEM_USER", "root") + t.Setenv("DOKKU_SYSTEM_GROUP", "root") Expect(PropertySetup(propertyTestPlugin)).To(Succeed()) } diff --git a/plugins/config/config_test.go b/plugins/config/config_test.go index e512fc42c..ef8b48d29 100644 --- a/plugins/config/config_test.go +++ b/plugins/config/config_test.go @@ -25,7 +25,11 @@ func setupTests() (err error) { return err } - return os.Setenv("PLUGIN_ENABLED_PATH", "/var/lib/dokku/plugins/enabled") + if err := os.Setenv("PLUGIN_ENABLED_PATH", "/var/lib/dokku/plugins/enabled"); err != nil { + return err + } + + return os.Setenv("PLUGIN_CORE_AVAILABLE_PATH", "/var/lib/dokku/core-plugins/available") } func setupTestApp() (err error) { diff --git a/plugins/scheduler-k3s/triggers_test.go b/plugins/scheduler-k3s/triggers_test.go index 3f142eaec..413512ede 100644 --- a/plugins/scheduler-k3s/triggers_test.go +++ b/plugins/scheduler-k3s/triggers_test.go @@ -13,6 +13,8 @@ func setupChartMigrationTest(t *testing.T) { t.Setenv("PLUGIN_PATH", "/var/lib/dokku/plugins") t.Setenv("PLUGIN_ENABLED_PATH", "/var/lib/dokku/plugins/enabled") t.Setenv("DOKKU_LIB_ROOT", t.TempDir()) + t.Setenv("DOKKU_SYSTEM_USER", "root") + t.Setenv("DOKKU_SYSTEM_GROUP", "root") Expect(common.PropertySetup("scheduler-k3s")).To(Succeed()) }