From ab14c97b2e797946e363e32e2222ab3ba620e09c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Tue, 30 Aug 2022 15:44:14 +0200 Subject: [PATCH] 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. --- internal/manager/api_impl/varrepl_test.go | 6 ++++-- internal/manager/config/settings_test.go | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/internal/manager/api_impl/varrepl_test.go b/internal/manager/api_impl/varrepl_test.go index 0318a213..395dbccf 100644 --- a/internal/manager/api_impl/varrepl_test.go +++ b/internal/manager/api_impl/varrepl_test.go @@ -136,9 +136,10 @@ func TestReplaceJobsVariable(t *testing.T) { c.SharedStoragePath = storagePath c.Shaman.Enabled = true }) + nativeCheckoutPath := crosspath.ToNative(conf.Shaman.CheckoutPath()) 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"]) } @@ -147,9 +148,10 @@ func TestReplaceJobsVariable(t *testing.T) { c.SharedStoragePath = storagePath c.Shaman.Enabled = false }) + nativeJobsPath := crosspath.ToNative(crosspath.Join(storagePath, "jobs")) 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"]) } } diff --git a/internal/manager/config/settings_test.go b/internal/manager/config/settings_test.go index dcc8980e..33a55b18 100644 --- a/internal/manager/config/settings_test.go +++ b/internal/manager/config/settings_test.go @@ -69,7 +69,7 @@ func TestStorageImplicitVariablesWithShaman(t *testing.T) { } assert.False(t, c.implicitVariables["jobs"].IsTwoWay) assert.Equal(t, - crosspath.ToSlash(c.Shaman.CheckoutPath()), + crosspath.ToNative(c.Shaman.CheckoutPath()), c.implicitVariables["jobs"].Values[0].Value) } @@ -97,7 +97,7 @@ func TestStorageImplicitVariablesWithoutShaman(t *testing.T) { } assert.False(t, c.implicitVariables["jobs"].IsTwoWay) assert.Equal(t, - crosspath.ToSlash(c.SharedStoragePath), + crosspath.ToNative(c.SharedStoragePath), c.implicitVariables["jobs"].Values[0].Value) }