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.
This commit is contained in:
Jose Diaz-Gonzalez committed 2026-05-31 02:23:35 -04:00
1 parent b8929712d4
commit 4ae48c6ea0
3 files changed
+9 -1

No files matched your search

+2
View File
@@ -19,6 +19,8 @@ func setupPropertyMapTest(t *testing.T) {
RegisterTestingT(t) RegisterTestingT(t)
Expect(setupTests()).To(Succeed()) Expect(setupTests()).To(Succeed())
t.Setenv("DOKKU_LIB_ROOT", t.TempDir()) t.Setenv("DOKKU_LIB_ROOT", t.TempDir())
t.Setenv("DOKKU_SYSTEM_USER", "root")
t.Setenv("DOKKU_SYSTEM_GROUP", "root")
Expect(PropertySetup(propertyTestPlugin)).To(Succeed()) Expect(PropertySetup(propertyTestPlugin)).To(Succeed())
} }
+5 -1
View File
@@ -25,7 +25,11 @@ func setupTests() (err error) {
return err 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) { func setupTestApp() (err error) {
+2
View File
@@ -13,6 +13,8 @@ func setupChartMigrationTest(t *testing.T) {
t.Setenv("PLUGIN_PATH", "/var/lib/dokku/plugins") t.Setenv("PLUGIN_PATH", "/var/lib/dokku/plugins")
t.Setenv("PLUGIN_ENABLED_PATH", "/var/lib/dokku/plugins/enabled") t.Setenv("PLUGIN_ENABLED_PATH", "/var/lib/dokku/plugins/enabled")
t.Setenv("DOKKU_LIB_ROOT", t.TempDir()) 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()) Expect(common.PropertySetup("scheduler-k3s")).To(Succeed())
} }