Manager: fix tests on Windows

Fix some tests that were failing because some parts of Flamenco now use
native path separators instead of always-forward ones.
This commit is contained in:
Sybren A. Stüvel 2022-08-30 15:44:14 +02:00
parent cbd8754595
commit ab14c97b2e
2 changed files with 6 additions and 4 deletions

View File

@ -136,9 +136,10 @@ func TestReplaceJobsVariable(t *testing.T) {
c.SharedStoragePath = storagePath c.SharedStoragePath = storagePath
c.Shaman.Enabled = true c.Shaman.Enabled = true
}) })
nativeCheckoutPath := crosspath.ToNative(conf.Shaman.CheckoutPath())
replacedTask := replaceTaskVariables(&conf, task, worker) replacedTask := replaceTaskVariables(&conf, task, worker)
expectPath := crosspath.Join(crosspath.ToSlash(conf.Shaman.CheckoutPath()), "path/in/storage.blend") expectPath := nativeCheckoutPath + "/path/in/storage.blend"
assert.Equal(t, expectPath, replacedTask.Commands[2].Parameters["filepath"]) assert.Equal(t, expectPath, replacedTask.Commands[2].Parameters["filepath"])
} }
@ -147,9 +148,10 @@ func TestReplaceJobsVariable(t *testing.T) {
c.SharedStoragePath = storagePath c.SharedStoragePath = storagePath
c.Shaman.Enabled = false c.Shaman.Enabled = false
}) })
nativeJobsPath := crosspath.ToNative(crosspath.Join(storagePath, "jobs"))
replacedTask := replaceTaskVariables(&conf, task, worker) replacedTask := replaceTaskVariables(&conf, task, worker)
expectPath := crosspath.Join(storagePath, "jobs", "path/in/storage.blend") expectPath := nativeJobsPath + "/path/in/storage.blend"
assert.Equal(t, expectPath, replacedTask.Commands[2].Parameters["filepath"]) assert.Equal(t, expectPath, replacedTask.Commands[2].Parameters["filepath"])
} }
} }

View File

@ -69,7 +69,7 @@ func TestStorageImplicitVariablesWithShaman(t *testing.T) {
} }
assert.False(t, c.implicitVariables["jobs"].IsTwoWay) assert.False(t, c.implicitVariables["jobs"].IsTwoWay)
assert.Equal(t, assert.Equal(t,
crosspath.ToSlash(c.Shaman.CheckoutPath()), crosspath.ToNative(c.Shaman.CheckoutPath()),
c.implicitVariables["jobs"].Values[0].Value) c.implicitVariables["jobs"].Values[0].Value)
} }
@ -97,7 +97,7 @@ func TestStorageImplicitVariablesWithoutShaman(t *testing.T) {
} }
assert.False(t, c.implicitVariables["jobs"].IsTwoWay) assert.False(t, c.implicitVariables["jobs"].IsTwoWay)
assert.Equal(t, assert.Equal(t,
crosspath.ToSlash(c.SharedStoragePath), crosspath.ToNative(c.SharedStoragePath),
c.implicitVariables["jobs"].Values[0].Value) c.implicitVariables["jobs"].Values[0].Value)
} }