diff --git a/addon/flamenco/operators.py b/addon/flamenco/operators.py index 71b97ffd..3a2d7c0a 100644 --- a/addon/flamenco/operators.py +++ b/addon/flamenco/operators.py @@ -321,8 +321,8 @@ class FLAMENCO_OT_submit_job(FlamencoOpMixin, bpy.types.Operator): # may have checked out at a different location than we # requested. # - # Having Shaman enabled on the Manager automatically creates a - # variable "jobs" that will resolve to the checkout directory. + # Manager automatically creates a variable "jobs" that will + # resolve to the job storage directory. self.blendfile_on_farm = PurePosixPath("{jobs}") / msg.output_path self._submit_job(context) diff --git a/internal/manager/api_impl/varrepl_test.go b/internal/manager/api_impl/varrepl_test.go index 0f86dcac..f52999cb 100644 --- a/internal/manager/api_impl/varrepl_test.go +++ b/internal/manager/api_impl/varrepl_test.go @@ -100,16 +100,31 @@ func TestReplacePathsUnknownOS(t *testing.T) { func TestReplaceJobsVariable(t *testing.T) { worker := persistence.Worker{Platform: "linux"} - // Having the Shaman enabled should create an implicit variable "{jobs}". - conf := config.GetTestConfig(func(c *config.Conf) { - c.SharedStoragePath = "/path/to/flamenco-storage" - c.Shaman.Enabled = true - }) - task := varreplTestTask() - task.Commands[2].Parameters["filepath"] = "{jobs}/path/in/shaman.blend" + task.Commands[2].Parameters["filepath"] = "{jobs}/path/in/storage.blend" - replacedTask := replaceTaskVariables(&conf, task, worker) - expectPath := path.Join(conf.Shaman.CheckoutPath(), "path/in/shaman.blend") - assert.Equal(t, expectPath, replacedTask.Commands[2].Parameters["filepath"]) + // An implicit variable "{jobs}" should be created, regardless of whether + // Shaman is enabled or not. + + { // Test with Shaman enabled. + conf := config.GetTestConfig(func(c *config.Conf) { + c.SharedStoragePath = "/path/to/flamenco-storage" + c.Shaman.Enabled = true + }) + + replacedTask := replaceTaskVariables(&conf, task, worker) + expectPath := path.Join(conf.Shaman.CheckoutPath(), "path/in/storage.blend") + assert.Equal(t, expectPath, replacedTask.Commands[2].Parameters["filepath"]) + } + + { // Test without Shaman. + conf := config.GetTestConfig(func(c *config.Conf) { + c.SharedStoragePath = "/path/to/flamenco-storage" + c.Shaman.Enabled = false + }) + + replacedTask := replaceTaskVariables(&conf, task, worker) + expectPath := "/path/to/flamenco-storage/jobs/path/in/storage.blend" + assert.Equal(t, expectPath, replacedTask.Commands[2].Parameters["filepath"]) + } }