Worker: check BLENDER_CMD environment variable (for multi-GPU Eevee rendering) #104193

Open
MKRelax wants to merge 9 commits from MKRelax/flamenco:worker-use-blender-from-env into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
2 changed files with 13 additions and 11 deletions
Showing only changes of commit cbbe96d500 - Show all commits

View File

@ -45,17 +45,21 @@ func TestGetBlenderVersion(t *testing.T) {
func TestGetBlenderCommandFromEnvironment(t *testing.T) {
// Without environment variable, we expect an empty string
// If the environment variable is unset or empty, we expect an empty string
err := os.Unsetenv(BlenderPathEnvVariable)
MKRelax marked this conversation as resolved Outdated

This should check that the environment variable isn't already set while running the test ;-)

This should check that the environment variable isn't already set while running the test ;-)
assert.NoError(t, err, "Could not clear blender executable from environment")
path := EnvironmentVariable()
assert.Equal(t, "", path)
// Try finding the blender path in the environment variable
err := os.Setenv(BlenderPathEnvVariable, "/path/specified/in/env/to/blender")
if err != nil {
t.Fatal("Could not set blender executable in environment variable")
}
err = os.Setenv(BlenderPathEnvVariable, "")
assert.NoError(t, err, "Could not set blender executable in environment")
MKRelax marked this conversation as resolved Outdated

The if and t.Fatal() can be replaced with require.NoError(t, err, "Could not set BLENDER_CMD environment variable").

The `if` and `t.Fatal()` can be replaced with `require.NoError(t, err, "Could not set BLENDER_CMD environment variable")`.
path = EnvironmentVariable()
assert.Equal(t, "/path/specified/in/env/to/blender", path)
assert.Equal(t, "", path)
// Try finding the blender path in the environment variable
envExe := `D:\Blender_3.2_stable\blender.exe`
err = os.Setenv(BlenderPathEnvVariable, envExe)
assert.NoError(t, err, "Could not set blender executable in environment")
path = EnvironmentVariable()
assert.Equal(t, envExe, path)
}

View File

@ -90,9 +90,7 @@ func TestCmdBlenderFromEnvironment(t *testing.T) {
envExe := `D:\Blender_3.2_stable\blender.exe`
err := os.Setenv(find_blender.BlenderPathEnvVariable, envExe)
if err != nil {
t.Fatal("Could not set blender executable in environment variable")
}
assert.NoError(t, err, "Could not set blender executable in environment")
taskID := "c5dfdfab-4492-4ab1-9b38-8ca4cbd84a17"
cmd := api.Command{