Parts-Based Manifest Publishing

This commit is contained in:
2026-04-09 21:22:26 +02:00
parent 94ffcc5868
commit 8f0b8a5d66
8 changed files with 596 additions and 89 deletions
+29 -28
View File
@@ -6,34 +6,6 @@ import (
"testing"
)
func TestTopDataAssetsDirDiscoversSiblingRepo(t *testing.T) {
root := t.TempDir()
mkdirAll(t, filepath.Join(root, "src"))
mkdirAll(t, filepath.Join(root, "assets"))
mkdirAll(t, filepath.Join(root, "build"))
parentDir := filepath.Dir(root)
siblingPath := filepath.Join(parentDir, "sow-assets")
mkdirAll(t, siblingPath)
mkdirAll(t, filepath.Join(siblingPath, "assets", "part", "belt"))
proj := &Project{
Root: root,
Config: Config{
Module: ModuleConfig{Name: "Test", ResRef: "test"},
Paths: PathConfig{Source: "src", Assets: "assets", Build: "build"},
TopData: TopDataConfig{
Assets: "sow-assets",
},
},
}
result := proj.TopDataAssetsDir()
if result != siblingPath {
t.Errorf("expected %s, got %s", siblingPath, result)
}
}
func TestTopDataAssetsDirPrefersExplicitConfig(t *testing.T) {
root := t.TempDir()
mkdirAll(t, filepath.Join(root, "src"))
@@ -59,6 +31,35 @@ func TestTopDataAssetsDirPrefersExplicitConfig(t *testing.T) {
}
}
func TestTopDataAssetsDirDoesNotAssumeSiblingRepo(t *testing.T) {
root := t.TempDir()
mkdirAll(t, filepath.Join(root, "src"))
mkdirAll(t, filepath.Join(root, "assets"))
mkdirAll(t, filepath.Join(root, "build"))
parentDir := filepath.Dir(root)
siblingPath := filepath.Join(parentDir, "sow-assets")
mkdirAll(t, siblingPath)
mkdirAll(t, filepath.Join(siblingPath, "assets", "part", "belt"))
proj := &Project{
Root: root,
Config: Config{
Module: ModuleConfig{Name: "Test", ResRef: "test"},
Paths: PathConfig{Source: "src", Assets: "assets", Build: "build"},
TopData: TopDataConfig{
Assets: "sow-assets",
},
},
}
result := proj.TopDataAssetsDir()
expected := filepath.Join(root, "sow-assets")
if result != expected {
t.Errorf("expected unresolved local path %s, got %s", expected, result)
}
}
func TestTopDataAssetsDirReturnsEmptyForNoConfig(t *testing.T) {
root := t.TempDir()
mkdirAll(t, filepath.Join(root, "src"))