test(backend): add tests for SERVER_BINARY, SERVER_PARAMS, STEAMCMD_PATH env vars
- TestStartWithServerBinaryEnv: custom binary name via env - TestStartWithServerParamsEnv: overridden params via env - TestServerParamsEnvOverridesSettings: env takes precedence over settings - TestSteamCmdManager_SteampathEnv: custom steamcmd path via env
This commit is contained in:
@@ -167,3 +167,21 @@ func TestNewSteamCmdManager(t *testing.T) {
|
||||
t.Error("new manager should not be running")
|
||||
}
|
||||
}
|
||||
|
||||
func TestSteamCmdManager_SteampathEnv(t *testing.T) {
|
||||
dir := t.TempDir()
|
||||
streamer := NewLogStreamer()
|
||||
|
||||
sm := NewSteamCmdManager(dir, streamer)
|
||||
|
||||
// Point STEAMCMD_PATH at the stub so it doesn't need the real binary
|
||||
stubPath, _ := filepath.Abs("testdata/steamcmd")
|
||||
t.Setenv("STEAMCMD_PATH", stubPath)
|
||||
|
||||
err := sm.DownloadMod("123456")
|
||||
if err != nil {
|
||||
t.Fatalf("DownloadMod with STEAMCMD_PATH env error = %v", err)
|
||||
}
|
||||
|
||||
waitForNotRunning(t, sm, 30*time.Second)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user