test(apply): cover symlinks, force, dry-run, merge, errors, state round-trip

This commit is contained in:
2026-05-23 11:55:01 +01:00
parent dd990cf25b
commit 5e35dc47fe
4 changed files with 541 additions and 4 deletions
+6
View File
@@ -12,6 +12,7 @@ import (
"github.com/lukaszraczylo/harness-sync/internal/canonical"
"github.com/lukaszraczylo/harness-sync/internal/gitx"
"github.com/lukaszraczylo/harness-sync/internal/merge"
"github.com/lukaszraczylo/harness-sync/internal/secrets"
)
// Options configures a Run call.
@@ -39,9 +40,14 @@ type Action struct {
Note string
}
// Run renders all adapters and writes their FileSets to disk.
// Conflicts are recorded as <dest>.rej files; processing continues past conflicts.
// Run renders all adapters and writes their FileSets to disk.
// Conflicts are recorded as <dest>.rej files; processing continues past conflicts.
func Run(opt Options) (*Report, error) {
if err := canonical.SubstituteSecrets(opt.Bundle, secrets.OSEnv); err != nil {
return nil, fmt.Errorf("env-var substitution: %w", err)
}
rep := &Report{}
for _, ad := range opt.Adapters {
files, err := ad.Render(opt.Bundle)